-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
31 lines (24 loc) · 885 Bytes
/
app.js
File metadata and controls
31 lines (24 loc) · 885 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
31
/**
* Created by asistent on 13.05.2016.
*/
var bodyParser = require('body-parser'),
path = require('path'),
template = require('consolidate').jade,
express = require('express'),
config = require('./config'),
todoController = require('./controller');
var app = express();
app.engine('jade', template);
app.set('view engine', 'jade');
app.set(express.static(path.join(__dirname, '/views')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.get('/', todoController.index);
app.post('/', todoController.getting);
app.post('/add', todoController.add);
app.post('/description', todoController.description);
app.post('/completed', todoController.completed);
app.post('/dell', todoController.dell);
app.listen(config.get('port'), function () {
console.log('Server is launched on: http://localhost:' + config.get('port'))
});