5

I'm working on putting a Parse Server on Heroku. I'm using this app:

https://github.com/ParsePlatform/parse-server-example

Uploading to heroku using this guide:

https://devcenter.heroku.com/articles/getting-started-with-nodejs

I've updated the db and server URLs in the parse server code, and everything uploads and deploys properly. However, when I attempt to use cURL to test the server as indicated in this guide:

https://github.com/ParsePlatform/parse-server

I get the following error:

{"error":"Unexpected token '"}

I have copied and pasted the cURL command, modified for my url:

curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://my-app-name.herokuapp.com/parse/classes/GameScore

Heroku logs show the request coming in (so I know it's going to the right place) but no errors. I'm deploying from Windows 7, if that matters. This is my first experience with heroku and parse server so I'm kind of flying blind. Anybody see the problem?

nasch
  • 5,330
  • 6
  • 31
  • 52

2 Answers2

0

Try to invert simple quote to double quote for your POST data field, it's work for me :

#here : "{'score':1337,'playerName':'Sean Plott','cheatMode':false}"

curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d "{'score':1337,'playerName':'Sean Plott','cheatMode':false}" http://my-app-name.herokuapp.com/parse/classes/GameScore

instead

#here : '{"score":1337,"playerName":"Sean Plott","cheatMode":false}'
curl -X POST -H "X-Parse-Application-Id: myAppId" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://my-app-name.herokuapp.com/parse/classes/GameScore
Dany Sousa
  • 229
  • 2
  • 16
0

I had that issue - for me the fix was is I was using a restApi key which is no longer needed in the Parse-Server.

It was also affecting my s3 adapter - was not allowing me to upload any images through dashboard.

I removed the restApi key and everything started working.

wackadoodle
  • 1
  • 1
  • 1