-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
23 lines (23 loc) · 812 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
/**
* Webserver
*/
var express = require('express');
var app = express();
var routes = require('./modules/routes'); //route handling logic
var port = 3000;
//static web pages in 'static' physical folder are available under 'html' virtual folder
app.use('/html', express.static('static'));
//nothing available in root folder.
app.get('/', function (req, res) {
res.status(403).send('Forbidden');
});
//start webserver
app.listen(port, function () {
console.log('Lifestats app listening on port 3000!');
});
//enable webservices
app.get('/ws/rtpi/:stopid', routes.RTPIData);
app.get('/ws/traffic/:setupid', routes.TrafficStats);
app.get('/ws/traveltime/:routeid', routes.TravelTime);
app.get('/ws/carparks', routes.CarParks);
app.get('/ws/stationtrains/:stationid', routes.StationTrains);