0

Running the stock parse-server (ps) example locally and remotely on Heroku works. Authenticating from cURL into the ps example with my cloud code (my app) works locally and remotely on Heroku.

  • cURL POST to local ps + local mongodb works
  • cURL GET to local ps + local mongodb works
  • cURL POST to local ps + mLab mongodb works
  • cURL GET to local ps + local mongodb works

    However,

  • cURL POST to Heroku ps + mLab mongodb doesn't work but instead results in Cannot POST /parse error.

Node file index.js is pointing to the correct heroku address of format https://myApp.herokuapp.com/parse/

Local cURL POST is adapted from the migration guide:

curl -X POST \
    -H "X-Parse-Application-Id: appID" \
    -H "X-Parse-Client-Key: clientKey" \
    -H "X-Parse-REST-API-Key: restKey" \
    -H "Content-Type: application/json" \
    -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
    http://localhost:1337/parse/classes/GameScore

Local cURL GET:

curl -X GET \
    -H "X-Parse-Application-Id: appID" \
    -H "X-Parse-Client-Key: clientKey" \
    -H "X-Parse-REST-API-Key: restKey" \
    http://localhost:1337/parse/classes/GameScore

Remote cURL POST :

curl -X POST \
    -H "X-Parse-Application-Id: appID" \
    -H "X-Parse-Client-Key: clientKey" \
    -H "X-Parse-REST-API-Key: restKey" \
    -H "Content-Type: application/json" \
    -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
    https://myApp.herokuapp.com/parse/

Tried trouble shooting tips here but didn't get anywhere. This SO post doesn't seem to help. Help!

Community
  • 1
  • 1
zelusp
  • 3,500
  • 3
  • 31
  • 65

1 Answers1

0

Notice how the remote cURL post doesn't end with the classes path designation. Use this as your remote POST target:

https://myApp.herokuapp.com/parse/classes/GameScore
zelusp
  • 3,500
  • 3
  • 31
  • 65