2016-04-26 37 views
5

Sto lavorando per mettere un server di analisi su Heroku. Sto utilizzando questa applicazione:Risposta server di analisi "Token inatteso"

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

Caricamento a Heroku utilizzando questa guida:

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

Ho aggiornato gli URL db e server nel codice del server di analisi, e tutto arrivi e distribuisce correttamente. Tuttavia, quando tento di usare curl per testare il server come indicato in questa guida:

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

ottengo il seguente errore:

{"error":"Unexpected token '"} 

ho copiato e incollato il comando curl, modificato per il mio 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 

ceppi Heroku mostrano la richiesta in arrivo (quindi so che sta andando al posto giusto), ma nessun errore. Sto distribuendo da Windows 7, se questo è importante. Questa è la mia prima esperienza con heroku e server di analisi, quindi sono un po 'cieco. Qualcuno vede il problema?

+1

stesso problema qui, alcune notizie? –

+0

Ho verificato la mia app in altri modi, ma provo le doppie virgolette con escape in Json. I backslash escapes penso. Fammi sapere se funziona. – nasch

+0

vedendo lo stesso proprio ora. Ho pubblicato anche la mia domanda. Questo è mai stato risolto? –

risposta

0

provate ad invertire semplice citazione di doppi apici per il vostro campo di dati POST, è lavoro per 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 

invece

#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

Grazie, farò un tentativo. – nasch

+0

Sfortunatamente questo non ha avuto alcun effetto - ottengo lo stesso identico errore. – nasch

0

ho avuto quel problema - per me la correzione è stata io stava usando una chiave restApi che non è più necessaria nel Parse-Server.

Stava interessando anche il mio adattatore s3 - non mi permetteva di caricare alcuna immagine tramite dashboard.

Ho rimosso il resto chiave APIO e tutto ha iniziato a funzionare.