-
Notifications
You must be signed in to change notification settings - Fork 14
/
server.js
34 lines (24 loc) · 877 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
'use strict';
const express = require('express');
const app = express();
app.set('port', (process.env.PORT || 5000));
// Serve static assets.
app.use('/examples', express.static('examples'));
app.use('/dist', express.static('dist'));
app.use(express.compress());
app.use(express.urlencoded());
const sendConfigurable = (req, res) => {
res.status(200).sendfile('./examples/googleMaps/configurable.html');
};
app.get('/google_basic', (req, res) => {
res.status(200).sendfile('./examples/googleMaps/basic.html');
});
app.get('/google_configurable', sendConfigurable);
app.get('/leaflet', (req, res) => {
res.status(200).sendfile('./examples/leaflet/basic.html');
});
app.get('/', sendConfigurable);
// Start the server
const server = app.listen(app.get('port'), () => {
console.log('App listening at http://%s:%s', server.address().address, app.get('port'));
});