forked from lmatteis/node-trello
-
Notifications
You must be signed in to change notification settings - Fork 3
/
web.js
34 lines (28 loc) · 930 Bytes
/
web.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
var express = require('express'),
config = require('./config'),
routes = require('./routes');
var app = express(express.logger());
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('view options', {layout: false});
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
var basicAuth = express.basicAuth(function(username, password) {
return (password == config.password);
}, 'Restrict area, please identify');
app.all('*', basicAuth);
// Routes
app.get('/', routes.index);
app.get('/stats', routes.stats);
app.get('/statscsv', routes.statscsv);
app.get('/burndown', routes.burndown);
app.get('/dashboard', routes.dashboard);
app.get('/api', routes.api);
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});