From c7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 Mon Sep 17 00:00:00 2001 From: yo mama Date: Sat, 4 Apr 2015 01:00:59 -0700 Subject: first --- config/http.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 config/http.js (limited to 'config/http.js') diff --git a/config/http.js b/config/http.js new file mode 100644 index 0000000..2901cd9 --- /dev/null +++ b/config/http.js @@ -0,0 +1,49 @@ +var config={ + port:8082, + apps:{ + + }, + server:{ + index:'index.html' + }, + contentType:{ + html: 'text/html', + css : 'text/css', + js : 'text/javascript', + txt : 'text/plain' + }, + restrictedType:{ + + } +} + +if(!process.env.SERVER_ROOT){ + console.log('SERVER_ROOT not specified, defaulting to current working dir.') + process.env.SERVER_ROOT=process.cwd(); +} + +config.rootDIR=process.env.SERVER_ROOT +console.log('config.rootDIR is '+config.rootDIR); + +function prod(){ + console.log('launched as prod'); + config.port=8083; + return config; +} + +function dev(){ + console.log('launched as dev'); + return config; +} + +module.exports = function(){ + switch(process.env.NODE_ENV){ + case 'dev': + return dev(); + case 'prod': + return prod(); + default: + console.log('NODE_ENV not specified so defaulting to dev.'); + return dev(); + } +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2