-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
34 lines (27 loc) · 803 Bytes
/
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
//roberto
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
var index = require('./routes/index');
var prices = require('./routes/prices');
var places = require('./routes/places');
var port = 3002;
var app = express();
//View Engine
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.engine('html', require('ejs').renderFile);
// Set Static Folder
app.use(express.static(path.join(__dirname, 'client')));
// Body Parser
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use('/', index);
app.use('/prices', prices);
app.use('/places', places);
app.listen(port, function(){
log("Server started on port " + port);
});
function log(text) {
console.log(new Date + ": " + text);
}