blob: 8ba061e430486818475dba4403d8fb6d09f1e119 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#! /usr/bin/env node
var path = require('path');
process.on('uncaughtException', function(err) {
console.error('uncaughtException: ' + (err.stack || err.message || err.toString()));
});
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.rootDir)));
config.Config.app = app;
var model = require('./model_' + config.modelBackend);
model.start(config.Config);
var frontend = require('./frontend');
frontend.setModel(model);
frontend.start(config.Config);
|