warn if node is not launched with 'NODE_ENV=production'

pull/1/head
ansuz 3 years ago
parent f34a60665f
commit af10547dca

@ -72,6 +72,8 @@ module.exports.create = function (config) {
NO_SANDBOX: NO_SANDBOX, NO_SANDBOX: NO_SANDBOX,
httpSafePort: httpSafePort, httpSafePort: httpSafePort,
NODE_ENV: process.env.NODE_ENV,
shouldUpdateNode: !isRecentVersion(), shouldUpdateNode: !isRecentVersion(),
version: Package.version, version: Package.version,

@ -332,6 +332,9 @@ nThen(function (w) {
currentVersion: process.version, 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.OFFLINE_MODE) { return; }
if (Env.websocketPath) { return; } if (Env.websocketPath) { return; }

Loading…
Cancel
Save