summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
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);