在Heroku上本地和远程运行stock parse-server(ps)示例。 使用我的云代码(我的应用程序)从cURL到ps示例进行身份验证,可以在Heroku上本地和远程工作。
cURL GET to local ps + local mongodb works
cURL POST到Heroku ps + mLab mongodb 没有工作但反而导致Cannot POST /parse
错误。
节点文件index.js
指向格式https://myApp.herokuapp.com/parse/
本地cURL POST改编自the migration guide:
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
本地cURL 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 POST:
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 :(得分:0)
注意远程cURL帖子如何以classes
路径指定结束。将其用作远程POST目标:
https://myApp.herokuapp.com/parse/classes/GameScore