-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (22 loc) · 889 Bytes
/
Copy pathapp.js
File metadata and controls
27 lines (22 loc) · 889 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
var express = require('express'),
home = require(__dirname+'/server/routes/home'),
occasion = require(__dirname+'/server/api/occasion');
var app = express();
app.set('view engine', 'kiwi')
app.set('views', __dirname+'/server/views');
app.use(express.logger('dev'))
app.use(express.json()); // to support JSON-encoded bodies
app.use(express.urlencoded());
app.use(express.static(__dirname + '/public'));
app.use(express.static(__dirname + '/bower_components'));
app.use(express.cookieParser('S3CRE7'));
app.use(express.session());
app.get('/',home.get);
app.post('/occasion', occasion.add);
app.put('/occasion', occasion.update);
app.get('/occasion', occasion.getAll);
app.get('/occasion/:id', occasion.getById);
app.delete('/occasion/:id', occasion.delete);
var server = app.listen(3000, function() {
console.log('Listening on port %d', server.address().port);
});