diff options
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); |