Created
March 14, 2017 00:42
-
-
Save JBreit/58bbddcda905b7f2bacabfaf4aa935e5 to your computer and use it in GitHub Desktop.
Part of an experimental Node.js configuration file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var normalizePort = require('./../../utils').normalizePort, | |
_defaults = [ | |
/*"NODE_ENV",*/ | |
"HOST", | |
"PORT" | |
]; | |
_defaults.forEach(function (name) { | |
'use strict'; | |
if (!process.env[name]) { | |
throw new Error('Environment variable ' + name + ' is missing'); | |
} | |
}); | |
var config = { | |
env: process.env.NODE_ENV, | |
server: { | |
host: process.env.HOST || 'http://127.0.0.1', | |
port: normalizePort(process.env.PORT || 8080) | |
} | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment