summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorBenjamin Kiessling <mittagessen@l.unchti.me>2011-11-17 23:52:43 +0100
committerBenjamin Kiessling <mittagessen@l.unchti.me>2011-11-17 23:52:43 +0100
commitbe0c922fccdaba96cb7dab391f03208745dc01d9 (patch)
tree38b3c41899f2572dc4efbe078c76e5e8077d1225 /main.js
parent3fd29331bf3342166f8d9fcb9173c7f40bc91b97 (diff)
Refactor code, update files dynamically, reading event file
Diffstat (limited to 'main.js')
-rw-r--r--main.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.js b/main.js
index f564ef0..29f47c4 100644
--- a/main.js
+++ b/main.js
@@ -1,5 +1,7 @@
#! /usr/bin/env node
+var path = require('path');
+
process.on('uncaughtException', function(err) {
console.error('uncaughtException: ' + (err.stack || err.message || err.toString()));
});
@@ -7,6 +9,15 @@ process.on('uncaughtException', function(err) {
process.chdir(__dirname);
var config = require('./config');
+var express = require('express');
+var app = express.createServer();
+
+app.use(express.logger());
+app.use(express.staticCache());
+app.use(express.static(path.join(__dirname, config.Config.dir)));
+
+config.Config.app = app;
+
var model = require('./model_' + config.modelBackend);
model.start(config.Config);