forked from jz2000/angular-training
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathserver.js
More file actions
32 lines (23 loc) · 783 Bytes
/
server.js
File metadata and controls
32 lines (23 loc) · 783 Bytes
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
var expressIO = require('express.io'),
serveStatic = require('serve-static');
var app = expressIO();
app.use(expressIO.cookieParser());
app.use(expressIO.session({secret: 'monkey'}));
app.http().io();
app.listen(8000);
// Session is automatically setup on initial request.
app.get('/', function(req, res) {
req.session.loginDate = new Date().toString();
res.sendfile(__dirname + '/build/index.html');
});
app.use(expressIO.static(__dirname + '/'));
app.use(expressIO.static(__dirname + '/build'));
app.get('/mentors', function(req, res) {
var result = require('./json/mentors.json');
res.json(result);
});
app.get('/mentees', function(req, res) {
var result = require('./json/mentees.json');
res.json(result);
});
exports = module.exports = app;