diff options
author | Benjamin Kiessling <mittagessen@l.unchti.me> | 2011-11-17 23:52:43 +0100 |
---|---|---|
committer | Benjamin Kiessling <mittagessen@l.unchti.me> | 2011-11-17 23:52:43 +0100 |
commit | be0c922fccdaba96cb7dab391f03208745dc01d9 (patch) | |
tree | 38b3c41899f2572dc4efbe078c76e5e8077d1225 /main.js | |
parent | 3fd29331bf3342166f8d9fcb9173c7f40bc91b97 (diff) |
Refactor code, update files dynamically, reading event file
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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); |