-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js~
30 lines (24 loc) · 890 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
var express = require('express');
var morgan = require('morgan');
var path = require('path');
var app = express();
app.use(morgan('combined'));
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'index.html'));
});
app.get('/ui/style.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
});
app.get('/ui/font.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'font.css'));
});
app.get('/ui/main.js', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'main.js'));
});
app.get('/ui/tile.png', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'tile.png'));
});
const PORT = process.env.PORT || 3000; // Use 8080 for local development because you might already have apache running on 80
app.listen(PORT, function () {
console.log(`Resources app listening on port ${PORT}!`);
});