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似乎沒有幫助。幫幫我!