-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
37 lines (30 loc) · 1.2 KB
/
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
// ====================================================
// EXPRESS
// ====================================================
var express = require('express');
var livereload = require('express-livereload');
var app = express();
// ====================================================
// APP CONFIG
// ====================================================
var conf = require('./app/config/conf.js');
var bodyParser = require('body-parser');
app.use(express.static(__dirname + '/app/assets/'));
app.set('views', __dirname + '/app/views');
app.set('port', conf.port);
app.set('view engine', 'jade');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(function(err, req, res, next){res.status(err.status || 500);});
// ====================================================
// ROUTING
// ====================================================
var router = require('./app/router')(app);
module.exports = app;
// ====================================================
// SERVER
// ====================================================
livereload(app, {watchDir: process.cwd() + "/app/"});
app.listen(app.get('port'), function(){
console.log('Listening on ' + app.get('port'));
});