forked from JulianNorton/weather-10kb-wxkb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (30 loc) · 1.07 KB
/
index.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
var compression = require('compression');
var express = require('express');
var moment = require('moment-timezone');
var minifyHTML = require('express-minify-html');
var weather10kb = require('./weather10kb');
var opbeat = require('opbeat')
var app = express();
app.locals.moment = moment;
app.use(compression());
app.use(minifyHTML({
override: true,
htmlMinifier: {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true,
minifyJS: true
}
}));
app.use(express.static(__dirname + '/public'));
app.use('/', weather10kb);
// Add the Opbeat middleware after your regular middleware
app.use(opbeat.middleware.express()) // injects opbeat, if error, registers in opbeat
// https://opbeat.com/docs/articles/get-started-with-express/#express-errors
app.set('port', (process.env.PORT || 5000));
app.set('view engine', 'ejs');
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});