diff --git a/lib/env.js b/lib/env.js index 1923dcc9e..516a9af7d 100644 --- a/lib/env.js +++ b/lib/env.js @@ -72,6 +72,8 @@ module.exports.create = function (config) { NO_SANDBOX: NO_SANDBOX, httpSafePort: httpSafePort, + NODE_ENV: process.env.NODE_ENV, + shouldUpdateNode: !isRecentVersion(), version: Package.version, diff --git a/server.js b/server.js index 80df1b526..30920abef 100644 --- a/server.js +++ b/server.js @@ -332,6 +332,9 @@ nThen(function (w) { currentVersion: process.version, }); } + if (Env.NODE_ENV !== 'production') { + Env.Log.warn("NODE_ENV", `If this server is running in a production context then it is recommended that you set NODE_ENV=production to prevent Expressjs from responding with stack traces when it catches an error.`); + } if (Env.OFFLINE_MODE) { return; } if (Env.websocketPath) { return; }