1
votes

This may be a stupid question... But I don't know where to find the index.js file and the main.js file of the cloud code in my parse android project.

1
I think its important to provide more information with regards to your setup. Are you running parse-server or using Parse.com? - Cliffordwh
@SnakeBlisken I don't actually know the difference, but I think it may be Parse.com - Mario Mouris
Well the one is the current service from parse.com ( soon to expire ) or your own environment ( hosting ) with the open source server installed on it. github.com/ParsePlatform/parse-server - Cliffordwh
@SnakeBlisken Ohh, then I'm hosting my own environment. - Mario Mouris
where is your environment hosted? AWS, Heroku, Local? - hybrdthry911

1 Answers

1
votes

If you using parse.com :

You need to use parse.com command line tool: you edit locally in your machine, and then deploy your code. More info, in parse.com documentacion: https://parse.com/docs/js/guide#cloud-code

If parse-server:

https://github.com/ParsePlatform/parse-server

Configure your servers path on initilization. Then in the main.js you can place your code. Remember there is many ways to initilize the server. Just read the docs on the repo to better understand it.

cloud: '/home/myApp/cloud/main.js', // Absolute path to your Cloud Code

Use a ftp client to make things easier when editing the file etc. remember when making changes to the main.js file you will need to restart the parse-server again.

For Heroku:

Alot easier, just use there backend to set path for the cloud code. If the main.js file doesnt exsist. Just create your own one and stipulate a path to that file using the variable editor in Heroku backend.
enter image description here https://devcenter.heroku.com/articles/deploying-a-parse-server-to-heroku#configuring-your-parse-server-with-config-vars