-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
34 lines (25 loc) · 817 Bytes
/
server.js
File metadata and controls
34 lines (25 loc) · 817 Bytes
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
require('use-strict');
require('strict-mode');
"use-strict"
var express = require('express');
var app = express();
app.get('/reporters.json', function (req, res) {
console.log('Serving reporters.json');
res.sendFile( __dirname + "/" + "reporters.json" );
});
app.get('/miserables.json', function (req, res) {
console.log('Serving miserables.json');
res.sendFile( __dirname + "/" + "miserables.json" );
});
// Server
// Make the public folder accessible
app.use(express.static('public'));
// Route for the root (pun intended)
app.get('/index.html', function (req, res) {
console.log('Serving index.html');
res.sendFile( __dirname + "/" + "index.html" );
});
// Set up server
var server = app.listen(process.env.PORT || 8081, () => {
console.log("Reporter Visualization listening at 8081");
});