./cloud/main.js
is the root file which we import on SashiDo's cloud. Don't change the name.
public/
is the directory in which you can put your html
, css
, js
, images
files, in case you want to host your app website on SashiDo for example :)
In order to test your Cloud Code locally, instead of pushing every time to the SashiDo's cloud when you want to test some code changes, you are able to run similar to the SashiDo's production Parse Server on your local computer and you'll see the changes and results immediately :)
The required version of NodeJS
is >=4.3
- https://nodejs.org/en/download/
- Via the package managers https://nodejs.org/en/download/package-manager/
You probably end up running it with:
mongod --dbpath <wherever your dbpath is>
If you want to use some specific npm packages you should add them to the package.json
. After that you just need to run:
npm install
If you need to customize you local app settings you are able to do it with ENV Variables:
DATABASE_URI
Default: 'mongodb://localhost:27017/dev'APP_ID
Default: 'myAppId'MASTER_KEY
: Default: '', but note that the Parse Dashboard code won't work with an empty MASTER_KEYSERVER_URL
: Default: http://localhost:1337/1'PORT
: Default: 1337
If you want to change DATABASE_URI
for example, run the following:
export DATABASE_URI=mongodb://localhost:27017/my_dev_db
Of course after 4 steps of configuring and installing it's time to start developing :) So ... write some code and run it with the following command:
npm start
That's it :) Happy coding :)
You probably want to use Parse Dashboard, which is a GUI for interacting w/ a Parse server, including database introspection and an API console for easy access to the API.
Follow the instructions at https://www.appcoda.com/parse-migration-part3/, noting that the configuration parameters are listed above. Remember that the dashboard doesn't work with the default empty MASTER_KEY
.
Start the dashboard with this, once inside the dashboard directory:
node ./Parse-Dashboard/index.js --masterKey <your chosen master key> --appId myAppId --serverURL http://localhost:1337/1
Production is a different repo. To push this repo to the prod repo, first add prod as a remote target in git:
git remote add prod https://github.com/parsegroundapps/pg-app-8hnin3szjcye8hhjecih9pxrjckzb2.git
You only have to do this once. Then, to push to production:
git push prod master