-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
28 lines (24 loc) · 813 Bytes
/
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
var express = require('express');
var path = require('path');
var http = require('http');
var bodyParser = require('body-parser');
var app = express();
/* All environments */
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
//app.use(bodyParser());
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, 'public')));
/* Create server */
http.createServer(app).listen(app.get('port'), function(){
console.log('NodeJS server running on port ' + app.get('port'));
});
/* Routes */
require('./routes/index')(app); // Index
require('./routes/customers')(app); // Customers
require('./routes/orders')(app); // Orders
require('./routes/products')(app); // Products