-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
58 lines (52 loc) · 1.55 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*jshint es5:true*/
var express = require('express'),
env = process.env.NODE_ENV,
inProduction = env === 'production',
inDevelopment = !inProduction,
app = express.createServer();
// Lactate servers for gzipping? (recommendation by Henry)
app.use('/public', express.static(__dirname + '/dist'));
app.use('/public', express.static(__dirname + '/public'));
// Pages is the server views dir
app.set('views', __dirname + '/pages');
app.set('view engine', 'jade');
// Send down index.html
app.get('/', function (req, res) {
res.render('index');
});
// // If we are in development, display test pages
// if (inDevelopment) {
app.get('/bootstrap_url_test', function (req, res) {
res.render('bootstrap_url_test');
});
app.get('/google_maps', function (req, res) {
res.render('google_maps');
});
app.get('/geolookup', function (req, res) {
res.render('geolookup');
});
app.get('/geospecify', function (req, res) {
res.render('geospecify');
});
app.get('/mapper_view', function (req, res) {
res.render('mapper_view');
});
app.get('/api_docs', function (req, res) {
res.render('api_docs');
});
// }
// Health page (attribution to dshaw)
var pkg = require('./package.json');
version = pkg.version;
app.get('/health', function (req, res) {
var health = {
'version': pkg.version,
'pid': process.pid,
'memory': process.memoryUsage(),
'uptime': process.uptime()
};
res.send(health);
});
// Begin listening and log accordingly
app.listen(8080);
console.log('Server running at http://localhost:8080/');