diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/chat.js | 26 | ||||
| -rw-r--r-- | config/http.js | 49 |
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 |
