summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-04-04 01:00:59 -0700
committeryo mama <pepper@scannerjammer.com>2015-04-04 01:00:59 -0700
commitc7c22e3db1c826bcfb2bc66651ec480aae0d4ae0 (patch)
tree8546df448afef40d3814d2581f4dacff7cebb87f /config
Diffstat (limited to 'config')
-rw-r--r--config/chat.js26
-rw-r--r--config/http.js49
2 files changed, 75 insertions, 0 deletions
diff --git a/config/chat.js b/config/chat.js
new file mode 100644
index 0000000..b3b04da
--- /dev/null
+++ b/config/chat.js
@@ -0,0 +1,26 @@
+var config={
+ port:8080
+}
+
+function prod(){
+ console.log('launched as prod');
+ config.port=8081;
+ 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
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