Most parts of my migration to open source parse-server are successful, with my data correctly stored, accessible.
I am however having problems with cloud code, specifically with running simple curl tests.
The initial parse-server installation includes a sample main.js file that contains a hello world function
My own parse installation is hosted at '/parse' so URLs use this as the root
The following is a simple request test
curl -X POST \
-H "X-Parse-Application-Id: myAppId" \
-H "X-Parse-REST-API-Key:myRESTKey" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/1/functions/hello
The response I get is
Cannot POST /parse/1/functions/hello
Which I take to be curls perfunctory statement that it cannot find a suitable POST endpoint
What is going wrong here? I have simply changed the sample curl example from Parse.com's documentation on using cloud-code to use my parse-server installation details
The answer is that unlike with Parses hosted solution the API version path is not something hosted with parse-server
if you host parse at e.g.: /parse as I have done above, then that is the relative URL where the functions API is available. So simply remove the /1/ from the path
The same curl command works with this URL
http://localhost:1337/parse/functions/hello
eg:
curl -X POST \
-H "X-Parse-Application-Id: myAppId" \
-H "X-Parse-REST-API-Key:myRESTKey" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/functions/hello
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With