2016-03-11 23 views
0

在Heroku上本地和遠程運行stock parse-server(ps)示例。 使用我的雲代碼(我的應用程序)在Heroku上進行本地和遠程工作時,從cURL驗證ps示例。從Parse.com引導 - 爲什麼cURL POST到parse-server在本地而不是在Heroku上運行?

  • 捲曲POST當地PS +本地MongoDB的工作
  • 捲曲GET當地PS +本地MongoDB的工作
  • 捲曲POST當地PS + MLAB MongoDB的工作
  • 捲曲GET當地PS +本地MongoDB的工作

    然而,

  • 捲曲POST到Heroku的PS + MLAB的MongoDB 工作,但會導致Cannot POST /parse錯誤。

節點文件index.js指向https://myApp.herokuapp.com/parse/

本地捲曲POST從the migration guide適應格式的正確的Heroku地址:

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 

本地捲曲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 

遠程捲曲張貼:

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/ 

試圖解決難題的參考here但沒有取得任何進展。 This SO post似乎沒有幫助。幫幫我!

回答

0

注意事項遠程cURL帖子如何不以classes路徑名稱結尾。將此用作遠程POST目標:

https://myApp.herokuapp.com/parse/classes/GameScore 
相關問題