Search code examples
meteor

Meteor build with settings.json


I've build my first Meteor APP with meteor build ../build.

But, when i start my app with node main.js, i've error because Meteor search information that is in my settings.json, but this information is not find.

Do you know if settings is build ?

Thank you every body,


Solution

  • Populate environment variable

    export METEOR_SETTINGS="$(cat /path/to/settings.json )"
    

    after the build step and before you execute your code

    To confirm your json is valid issue

    echo "$METEOR_SETTINGS" | jq .
    

    which uses the command line utility jq

    here is a redacted content of env var METEOR_SETTINGS ( same as /path/to/settings.json )

    echo $METEOR_SETTINGS | jq .
    
    {
      "public": {
        "rootUrl": "https://example.com",
        "secure": true,
        "minSearchChars": 2,
        "supportEmail": "support@coolstartup.com",
        "fromUser": "support@example.com",
        "GcmSender": 8577956,
        "maxBodySize": 15,
        "cordovaHost": "http://localhost:12416",
        "failedAuthsLimit": 5
      },
      "environ": {
        "enduserUrl": "https://example.com",
        "adminUrl": "https://admin.example.com",
        "scanUrl": "example.com:3310",
        "scanTries": 4,
        "opsCheckToken": "foobaroJ1b3UOi",
        "bootstrapUser": {
          "name": "Server Daemon",
          "email": "daemon@coolstartup.com",
          "password": "123123"
        },
        "pollingTries": 5,
        "expireResetToken": 1,
        "expireEnrollToken": 8,
        "fromUser": "support@example.com",
        "replyTo": "support@coolstartup.com"
      },
      "notifs": {
        "apn": {
          "expiry": 1123200,
          "production": false,
          "appName": "app"
        },
        "gcm": {
          "timeToLive": 1123200
        }
      },
      "vidyoyoyoyo": {
        "key": "f6acfc0ea9d ",
        "appID": "d06eec.o.io",
        "userName": "foo@bar.com",
        "expiresInSeconds": 10000
      },
      "logLevel": 4,
      "jsonSpaces": 0
    }