-
Notifications
You must be signed in to change notification settings - Fork 79
/
app-server.js
39 lines (31 loc) · 871 Bytes
/
app-server.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Module dependencies.
*/
var express = require('express'),
routes = require('./scripts/lib/dev-server-support'),
childProcess = require('child_process'),
path = require('path');
var app = module.exports = express();
// Configuration
app.engine('.html', require('ejs').__express);
app.set('views', path.join(__dirname, 'demo'));
app.set('view engine', 'html');
app.configure(function(){
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static(path.join(__dirname, 'demo')));
});
app.configure('development', function(){
app.use(express.errorHandler({
dumpExceptions: true,
showStack: true
}));
app.set('view options', {
pretty:true
});
});
app.configure('production', function(){
app.use(express.errorHandler());
});
// redirect all to the index (HTML5 history)
app.get('*', routes.index);