-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
34 lines (27 loc) · 946 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
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var express = require('express');
var fs = require('fs');
// Web App
var app = express();
var router = express.Router();
var path = __dirname + '/';
router.use(function (req, res, next) {
console.log('/' + req.method);
next();
});
router.get('/',function(req, res){
res.sendFile(path + 'index.html');
});
app.use('/',router);
app.use('/js', express.static(__dirname + '/js'));
app.use('/css', express.static(__dirname + '/css'));
app.use('/img', express.static(__dirname + '/img'));
app.use('/fonts', express.static(__dirname + '/fonts'));
/*app.get('/selectedprono', function (req, res) {
var prono = db.exec('SELECT raw FROM doublechances WHERE id_game NOT IN (SELECT id_game FROM results) ORDER BY id_game ASC LIMIT 1;');
res.json(prono);
});*/
var port = process.env.PORT;
app.listen(port || 3000, function () {
console.log('Live at Port 3000');
});