Bagusflyer
Bagusflyer

Reputation: 12925

Parse cloud code return 114 function not found

I followed the instruction of parse.com to create a new site including cloud code and public. The static page works. But the cloud code doesn't work.

Here is the code in main.js:

Parse.Cloud.define("hello", function(request, response) {
  response.success("Hello world!");
});

And I'm using curl to test this code after I run parse deploy.

curl -X POST \
  -H "X-Parse-Application-Id: myAppId" \
  -H "X-Parse-REST-API-Key: myAPIKey" \
  -H "Content-Type: application/json" \
  -d '{}' \
  https://api.parse.com/1/functions/hello

It returns:

{"code":141,"error":"function not found"}

Any idea? Thanks

Upvotes: 2

Views: 322

Answers (1)

Peter Zverkov
Peter Zverkov

Reputation: 143

You can test your Cloud function using curl. Make sure to replace your_app_id and your_rest_api_key with your actual Application ID and REST API Key:

curl -X POST \
  -H "X-Parse-Application-Id: your_app_id" \
  -H "X-Parse-REST-API-Key: your_rest_api_key" \
  -H "Content-Type: application/json" \
  -d '{}' \
  https://api.parse.com/1/functions/hello

Upvotes: -2

Related Questions