close
The Wayback Machine - https://web.archive.org/web/20200927115526/https://github.com/lorenwest/node-config/wiki/Multiple-Node-Instances
Skip to content

Multiple Node Instances

Loren West edited this page Jul 14, 2014 · 1 revision

In order to support different configurations for each application instance running on a machine, the NODE_APP_INSTANCE environment variable is inspected, and used for loading instance specific files.

For example, if the NODE_APP_INSTANCE=3 environment variable is set, immediately following the load of default.json, a file by the name of default-3.json will be loaded if present.

This works for all configuration files, so if your NODE_APP_INSTANCE=3 and NODE_ENV=stage, then immediately after loading stage.yaml, a file by the name of stage-3.yaml will be loaded if present.

You can’t perform that action at this time.