-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample Javascript Code for Calling Cloud Code on Localhost #2771
Comments
Hi @ srmurrayray, check out the answers to your question on stackoverflow. |
No solutions there..... |
I removed the "Parse.cloud = './cloud/main.js';" line. Still getting the same 404 error. Did not see any new answers on Stackoverflow. I've scoured the web for answers of how to use Javascript to call Parse-Server Cloud Code. Nothing other than the Parse-Server-Example/test which uses XHR, which I don't understand. |
Alrighty, I'm pretty sure I can help you out. I've got some questions: http://stackoverflow.com/questions/39665496/calling-locally-hosted-parse-server-cloud-code-with-javascript/39678505#39678505 |
Issue Description
I have Parse-Server hosted locally and I have the Parse-Server-Example test working. I'm able to call the example cloud code function using the test code (/test) that Parse-Server-Example uses. When I replace the main.js file with my legacy cloud code (from Parse.com hosted server), I can't seem to figure out how to call it. The Parse-Server-Example /test call to my replaced cloud code works just fine. I just can't seem to call the cloud code from my own javascript. Here's my client side javascript code:
Above code throws the following error:
Failed to load resource: the server responded with a status of 404 (Not Found) http://192.168.1.239:1337/parse/1/functions/hello
The Parse-Server-Example/test code calls my Cloud Code just fine. But, I can't follow the sample code in that example. I gather from various sources that the above code is how to properly call Parse-Server Cloud Code. Would be great to have a simple proper javascript method for calling Parse-Server Cloud Code.
I asked same question on Stackoverflow, but not getting very far there:
[http://stackoverflow.com/questions/39665496/calling-locally-hosted-parse-server-cloud-code-with-javascript(url)
Describe your issue in as much detail as possible.
see above
Steps to reproduce
Expected Results
call Cloud Code
Actual Outcome
see above
Environment Setup
Logs/Trace
You can turn on additional logging by configuring VERBOSE=1 in your environment.
[FILL THIS OUT]
The text was updated successfully, but these errors were encountered: