-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
48 lines (39 loc) · 975 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
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
'use strict';
require('newrelic');
/*
* Global Vars
*/
var express = require('express'),
hbs = require('express-hbs'),
serveStatic = require('serve-static'),
compression = require('compression'),
riotKey = require('./apikey'),
app = express(),
port = 3000;
require('./routes/nexus_route.js')(app, riotKey);
// For gzip compression
app.use(compression());
app.engine('hbs', hbs.express3({
partialsDir: __dirname + '/views/partials',
defaultLayout: __dirname +'/views/layouts/main.hbs',
}));
app.get('/riot.html', function(req, res, next) {
res.render('riot.hbs', {
layout: null
});
});
app.use(express.static(__dirname + '/assets'));
// Set Handlebars
app.set('view engine', 'hbs');
/*
* Routes
*/
// Index Page
app.get('/', function(request, response, next) {
response.render('index');
});
/*
* Start it up
*/
app.listen(process.env.PORT || port);
console.log('Express started on port ' + port);