From 7e6f81cd10646e597f598da7ac2983277cb5029d Mon Sep 17 00:00:00 2001 From: cubedro Date: Thu, 12 Feb 2015 04:55:09 +0200 Subject: [PATCH] added custom config option --- .gitignore | 1 + app.js | 7 ++++++- config.js => config.default.js | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) rename config.js => config.default.js (63%) diff --git a/.gitignore b/.gitignore index 48f303e..e7156bc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ */**/.DS_Store node_modules npm-debug.log +config.js *~ *.swp *.pem diff --git a/app.js b/app.js index 30cf339..3683a12 100644 --- a/app.js +++ b/app.js @@ -1,11 +1,16 @@ var express = require('express.io'); var path = require('path'); var fs = require('fs'); +var config; var app = express(); app.http().io(); -var config = require('./config'); +if(fs.existsSync('./config.js')){ + config = require('./config'); +} else { + config = require('./config.default'); +} var node = new require('./lib/node')(config); diff --git a/config.js b/config.default.js similarity index 63% rename from config.js rename to config.default.js index 8a24922..d5427c8 100644 --- a/config.js +++ b/config.default.js @@ -3,7 +3,9 @@ var config = { type: 'C++', os: 'linux', rpcHost: 'localhost', - rpcPort: '8080' + rpcPort: '8080', + serverHost: 'localhost', + serverPort: '3000' }; module.exports = config; \ No newline at end of file