5
votes

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?

2
same problem here, some news? - Claudio Castro
I've verified my app in other ways but try escaped double quotes in the Json. Backslash escapes I think. Let me know if it works. - nasch
seeing the same just now. I posted my own question too. Was this ever resolved? - Jdizzle Foshizzle
I don't think I ever figured out why cURL wasn't working. - nasch

2 Answers

0
votes

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
0
votes

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.