Search code examples
javascriptparse-server

How to use ParseServerOptions


I am using Parse Server v2.8.2. I am trying to use src/Options/index.js to rebuild src/Options/Definitions.js using the following command

$ node resources/buildConfigDefinitions.js

But when I execute this command, nothing seems to happen. Besides when I run

parse-server --appId=def --masterKey=abc - databaseURI=mongodb://localhost/test

I can't get the configuration I'm setting in the

src/Options/index.js file.

Does anyone know how this works and how to actually get the configuration in the index.js file?

Thank you!


Solution

  • forget the rebuild. You can combine .env settings AND specify a config file both on the cmdLine, letting the default priorities establish themselves for actual , runtime config.properties...

    since you are with node...

    package.json

      "scripts": {
        ...
        "start": "node ./bin/parse-server -- lib/conf.json",
    

    .env OR cli settings ...

    VERBOSE=1
    PORT=1337
    PARSE_SERVER_APPLICATION_ID=06rc7
    PARSE_SERVER_MASTER_KEY=wwTQ
    PARSE_SERVER_URL=http://localhost:1337/parse
    PARSE_PUBLIC_SERVER_URL=http://localhost:1337/parse
    PARSE_SERVER_DATABASE_URI=mongodb://parse:adm@931.mb.com:13931/ntst
    FIREBASE_SERVICE_ACCOUNT_KEY=../lib/fbidentity.json
    FIREBASE_
    AWS_ACCESS_KEY_ID=AKYA
    AWS_SECRET_ACCESS_KEY=Marw9
    S3_BUCKET=y
    S3_REGION=
    

    conf.json ...

    {
    "databaseURI": "",
    "appId": "",
    "masterKey": "",
    "serverURL": "",
    "verifyUserEmails": true,
    "publicServerURL": "",
    "appName": "Yayatv App",
    "filesAdapter": {
        "module": "@parse/s3-files-adapter",
        "options": {
          "bucket": "",
          "region": ""
        }
    },
    "emailAdapter": {
      "module": "@parse/simple-mailgun-adapter",
      "options": {
        "fromAddress": "no-reply@mg.tv.tv",
        "domain": "mg.yv.tv",
        "apiKey": "key-478"
      }
    },
    "auth" : {
       "firebase" : {
           "module" : "parse-server-firebase-auth-adapter"
       }
    }
    }