First of all you are required to setup a parse server where you can easily deploy Cloud Code.
You can setup Parse Server on various platforms -
- Heroku and mLab
- AWS and Elastic Beanstalk
- Google App Engine
- Microsoft Azure
- SashiDo
- Digital Ocean
- Pivotal Web Services
- Back4app
- Gomix
- Flynn
How to setup
NOTE
I recommend setting up Parse server on Back4App
-
First you need to download the app from the Github repo
-
Now open the App on Android Studio
-
Open strings.xml
-
Now you need to make some changes in strings.xml
-
Replace APP_KEY with your Server Application ID
-
Replace CLIENT_KEY with your server Client Key
-
If you are not using Back4app you need to replace the server string.
-
-
Go to your App Dashboard at Back4App website.
-
Navigate to app’s settings: Click on Features > Core Settings block > Server.
-
Return to your strings.xml file and paste your applicationId and clientKey
NOTE
No need to change server string for Back4App
-
Go to the AWS console
-
Select EC2 Services
-
Open EC2 Instances
-
Select your parse EC2 instance
-
Copy EC2 Instance Public DNS.
-
Append Public DNS with /parse/
-
Update it in strings.xml
-
First you need to open Server Setting for an app on Back4App Dashboard
-
Now you need to select Cloud code setting.
-
Now upload the cloud code file by clicking on Choose Files
-
Now select the file containing Cloud Code
-
Now click Save
Now Cloud code is updated to your Back4App server
The main.js file contains the Cloud code.
There are 2 types of Cloud code
-
NoSQL based
-
MySQL based
Number of NoSQL Based Cloud functions: 9
- You need to make 3 Classes
-
Movies
Fields:
- name ( Type: String )
- duration ( Type: Number )
-
Files
Fields:
- files ( Type: Files )
-
Profile Photo
Fields:
- profile_photo ( Type: Files )
NOTE
It is not necessary to enter same data in your classes. However data entered must satisfy coloumn data type.