forked from apfeuti/covid19-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
21 lines (14 loc) · 658 Bytes
/
server.js
File metadata and controls
21 lines (14 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var express = require('express'),
app = express(),
port = process.env.PORT || 3000,
bodyParser = require('body-parser');
//app.use(bodyParser.urlencoded({ extended: true }));
//app.use(bodyParser.json());
var routes = require('./api/routes');
routes(app);
app.use(express.static('static'));
app.use(function(req, res) {
res.status(404).send({url: req.originalUrl + ' not found. This API is work in progress and backward-compatibility is not guaranteed yet. Please consult the api-doc frequently: https://github.com/apfeuti/covid19-rest'})
});
app.listen(port);
console.log('openZH-covid19 RESTful API server started on port: ' + port);