what is cloud code host url ?

345 views
Skip to first unread message

ssamkyu

unread,
Mar 14, 2016, 6:32:58 AM3/14/16
to back{4}app
I upload my cloudcode files on "cloud code settings"
but, I can't find cloud code host url...so, I can't send "Get" request for test...

plz let me know...

Davi Macêdo

unread,
Mar 14, 2016, 10:21:05 PM3/14/16
to back{4}app

Cloud codes are currently only available for POST requests and you have to define them using Parse.Cloud.define method.


They will be available in https://parseapi.back4app.com/functions/YOUR_FUNCTION_NAME. You have to send your appId and keys in the reader and the parameters in the body. You can use console located in dashboard to test it.


You can find more information in the link below:

https://parse.com/docs/cloudcode/guide#cloud-code-cloud-functions

T Toofoo

unread,
Mar 15, 2016, 12:37:14 PM3/15/16
to back{4}app
I obtain an "Invalid function." when I try to call a cloud function from an Android client or directly from the  REST Console API as well. I deleted all unused .js code and put my cloud function directly in the Main.js file that I uplaoded under "/cloud" folder from the admin console. It worked on Parse  but not with back4app.

Davi Macêdo

unread,
Mar 16, 2016, 8:22:17 AM3/16/16
to back{4}app
The name of main file should be "main.js" (lowercase). Could you try again?

Does it work in Parse with uppercase? If does, maybe it is a good idea to also allow it in back4app.

T Toofoo

unread,
Mar 16, 2016, 9:29:50 AM3/16/16
to back{4}app
like in Parse I used the name in lowercase "main.js" (actually did'nt try with Upercase, it was just a mispelling in my previous post) 

Davi Macêdo

unread,
Mar 17, 2016, 10:59:18 AM3/17/16
to back{4}app
We had some instabilities with the initial release of cloud code in some users respositories. Probably that's the reason. It is now fixed and we apologize for it. Could you try again? If you keep receiving the same error, please send me your app id through chat so I can check your logs.

alexan...@googlemail.com

unread,
Apr 8, 2016, 4:47:37 AM4/8/16
to back{4}app
works great also if you call from command line:

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

[command line]
curl -X POST \
  -H "X-Parse-Application-Id: APPLICATION_ID" \
  -H "X-Parse-REST-API-Key: REST_API_KEY" \
  -H "Content-Type: application/json" \
  https://parseapi.back4app.com/functions/hello
 
result -->
{"result":"Hello world!"}
Reply all
Reply to author
Forward
0 new messages