Skip to content

Configuration

Daniel M. Hendricks edited this page Dec 1, 2019 · 1 revision

Configuration files are located in the config directory. default.json is used when NODE_ENV is not defined or where a matching environment configuration file does not exist.

Setting Environment

If you'd like to have a different configuration file a particular environment ("production", for example):

  1. Set the environment at the command line: export NODE_ENV=production
  2. Create a config/production.json file with variables from config/default.json that you'd like to override. Example:
{
    "server": {
        "address": "0.0.0.0"
    },
    "demo_page": false,
    "api_keys": [
        "abc123def",
        "tuv456xyz"
    ],
    "sockets": [
        "my-socket-name"
    ]
}

⚠️ If api_keys is an empty array, validation will not occur and all message will be accepted (useful for local development and debugging, not recommended when publicly accessible).

📌 See restify-cors-middleware for CORS configuration options.

Clone this wiki locally