We use environment variables for configuration and storing secret credentials. They are set by the production / test servers and Travis and can also be set locally; the easiest way is to edit the (gitignored) .env
file in the project's root directory:
MY_ENV_VARIABLE=hello
# Lines beginning with # are comments
NODE_ENV=production
Every script that uses environment variables must require lib/load-env-file.js
first (usually placed right after all the other require
calls). Note that require(...)
takes a relative path beginning with ./
or ../
.
Please update these docs and cli/debug-env-variables.js
after introducing new variables.
Name | Possible values | Description |
---|---|---|
ALLOW_SEARCH_INDEXING |
allowed or anything else |
If the value is not allowed , a <meta> tag is added to tell search engines not to index the page. (This is only allowed in the production deployment) |
GITHUB_USER_TOKEN |
A 40-digit GitHub access token | Used to create pull request when adding fixtures and create/delete comments after running GitHub tests |
GITHUB_BROKEN_LINKS_ISSUE_NUMBER |
A GitHub issue number | Used by tests/external-links.js |
NODE_ENV |
production or development (default) |
Introduced by Express.js, production enables caching, minimizing and more optimizations improving the performance a lot. |
PORT |
A free port number, defaults to 5000 |
On which port to start the server. |
TRAVIS_BRANCH |
Set by Travis | |
TRAVIS_COMMIT |
Set by Travis | |
TRAVIS_JOB_WEB_URL |
Set by Travis | |
TRAVIS_PULL_REQUEST |
Set by Travis | |
TRAVIS_PULL_REQUEST_SLUG |
Set by Travis | |
TRAVIS_REPO_SLUG |
Set by Travis |