Allow the webservice to run automatically

This commit is contained in:
Rowan Manning
2013-11-21 09:12:54 +00:00
parent ec9f82aa6f
commit 8f636173a0
5 changed files with 33 additions and 4 deletions

7
app.js
View File

@@ -13,11 +13,16 @@ module.exports = initApp;
function initApp (config, callback) {
config = defaultConfig(config);
var webserviceUrl = config.webservice;
if (typeof webserviceUrl == 'object') {
webserviceUrl = 'http://' + webserviceUrl.host + ':' + webserviceUrl.port + '/';
}
var app = new EventEmitter();
app.address = null;
app.express = express();
app.server = http.createServer(app.express);
app.webservice = createClient(config.webservice);
app.webservice = createClient(webserviceUrl);
// Compression
app.express.use(express.compress());