-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
36 lines (24 loc) · 756 Bytes
/
server.js
File metadata and controls
36 lines (24 loc) · 756 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
35
36
const express = require('express');
const app = express();
const helmet = require('helmet');
const bodyParser = require("body-parser");
const cors = require('cors')
let path = require('path');
app.use(bodyParser.json());
app.use(
bodyParser.urlencoded({
extended: true
})
);
// app.use(cors());
// app.use( express.static(path.join(__dirname + '/web/')));
app.use(helmet());
app.use ('/static', express.static('web'));
app.use('/build', express.static('build'));
app.listen(4000, () => console.log('listening on port 4000'));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/public/visor.html'));
});
app.get('/web/viewer.html', function(req, res) {
res.sendFile(path.join(__dirname + '/web/viewer.html'));
})