vmware-marketplaceparse

Add custom cloud code to Parse Server

There are some cases where you may want to develop your own cloud code, so as to make Parse work in a non-standard way, or make it perform a desired operation when certains conditions are met. You can find more information about this in the Parse official documentation. In order to add your custom cloud code to your Parse Server stack, please follow the steps below:

  • Stop the Parse server:

        $ sudo /opt/bitnami/ctlscript.sh stop parse
        $ sudo /opt/bitnami/ctlscript.sh stop parse-dashboard
    
  • Create a cloud directory in /opt/bitnami/parse/cloud:

        $ sudo mkdir -p /opt/bitnami/parse/cloud
    
  • Edit the script at /opt/bitnami/parse

        $ cd /opt/bitnami/parse
        $ vim config.json
    
  • Edit the file following the example below:

        {
          "appId": "APP_ID",
          "masterKey":  "MASTER_KEY",
          "appName": "APP_NAME",
          "mountPath": "/parse",
          "port": "1337",
          "host": "SERVER-IP",
          "cloud": "/opt/bitnami/cloud/main.js",
          "serverURL": "http://SERVER-IP:80/parse",
          "databaseURI": "mongodb://root:MONGODB_PASSWORD@127.0.0.1:27017/bitnami_parse",
        }
    

    Remember to replace the MONGODB_PASSWORD, APP_ID, MASTER_KEY, APP_NAME and SERVER-IP placeholders with your MongoDB administrator account password, application ID, application master key, application name and server’s public IP address respectively.

  • Restart the Parse server:

        $ sudo /opt/bitnami/ctlscript.sh start parse
    
Last modification December 21, 2022