-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
50 lines (36 loc) · 1.26 KB
/
app.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
40
41
42
43
44
45
46
47
48
/**
* Created with JetBrains WebStorm.
* User: tikhonov
* Date: 9/10/13
* Time: 9:18 PM
* To change this template use File | Settings | File Templates.
*/
var application_root = __dirname,
path = require('path'),
express = require('express');
var app = express();
app.configure(function () {
// app.set('views', __dirname + '/views');
app.use(express.logger());
//checks request.body for HTTP method overrides
app.use(express.methodOverride());
app.use(express.cookieParser());
//parses request body and populates request.body
app.use(express.bodyParser());
app.use(express.session({secret: "laksdfjalsdkjflsakjdf"}));
app.use(app.router);
//Where to serve static content
app.use(express.static(path.join(application_root, './src')));
// //Show all errors in development
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('development', function () {
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.get('/jsplumbchar', function(req,res) {
res.sendfile('./src/jsPlumbChar.html');
})
var port = 8080;
app.listen(port, function () {
console.log('Express server listening on port %d in %s mode', port, app.settings.env);
});