зеркало из https://github.com/mozilla/fxa.git
fix(config): make NODE_ENV consistent across servers mozilla/fxa-profile-server#227)
Related to https://github.com/mozilla/fxa/issues/57
This commit is contained in:
Родитель
82be94346e
Коммит
8be5c26332
|
@ -6,7 +6,7 @@ const config = require('../lib/config').getProperties();
|
|||
const logger = require('../lib/logging')('bin._static');
|
||||
const server = require('../lib/server/_static').create();
|
||||
|
||||
if (config.env !== 'dev') {
|
||||
if (config.env !== 'development') {
|
||||
logger.warn('sanity-check', 'static bin should only be used for local dev!');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"env": "development",
|
||||
"logging": {
|
||||
"fmt": "pretty",
|
||||
"level": "all",
|
||||
|
|
|
@ -39,8 +39,8 @@ const conf = convict({
|
|||
arg: 'node-env',
|
||||
doc: 'The current node.js environment',
|
||||
env: 'NODE_ENV',
|
||||
format: ['dev', 'test', 'stage', 'prod'],
|
||||
default: 'dev'
|
||||
format: ['development', 'test', 'stage', 'production'],
|
||||
default: 'production'
|
||||
},
|
||||
events: {
|
||||
region: {
|
||||
|
|
|
@ -6,5 +6,5 @@ const config = require('./config');
|
|||
|
||||
exports.isProdLike = function isProdLike() {
|
||||
var env = config.get('env');
|
||||
return env === 'prod' || env === 'stage';
|
||||
return env === 'production' || env === 'stage';
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@ if (!fs.existsSync(PUBLIC_DIR)) {
|
|||
|
||||
function LocalDriver() {
|
||||
var env = config.get('env');
|
||||
if (env !== 'dev' && env !== 'test') {
|
||||
if (env !== 'development' && env !== 'test') {
|
||||
logger.warn('sanity-check', 'using img.local driver with non-dev env!');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ function trimLocale(header) {
|
|||
// This is the webserver. It's what the outside always talks to. It
|
||||
// handles the whole Profile API.
|
||||
exports.create = function createServer() {
|
||||
var isProd = config.env === 'prod';
|
||||
var isProd = config.env === 'production';
|
||||
var server = new Hapi.Server({
|
||||
debug: false,
|
||||
connections: {
|
||||
|
@ -129,7 +129,7 @@ exports.create = function createServer() {
|
|||
|
||||
var routes = require('../routing');
|
||||
if (isProd) {
|
||||
logger.info('prod', 'Disabling response schema validation');
|
||||
logger.info('production', 'Disabling response schema validation');
|
||||
routes.forEach(function(route) {
|
||||
delete route.config.response;
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@ const path = require('path');
|
|||
const mkdirp = require('mkdirp');
|
||||
const rimraf = require('rimraf');
|
||||
|
||||
process.env.NODE_ENV = 'dev';
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
var childServer = cp.fork(path.join(__dirname, '..', 'bin', 'server.js'));
|
||||
childServer.on('exit', process.exit);
|
||||
|
|
Загрузка…
Ссылка в новой задаче