-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathserver.js
36 lines (30 loc) · 1.17 KB
/
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
35
36
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use('/index.html', serveStatic(__dirname + '/public/index.html', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Document-Isolation-Policy', 'isolate-and-require-corp');
}
}));
app.use('/page1', serveStatic(__dirname + '/public/page1.html', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Document-Isolation-Policy', 'isolate-and-require-corp');
}
}));
app.use('/page2', serveStatic(__dirname + '/public/page2.html', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Document-Isolation-Policy', 'isolate-and-require-corp');
}
}));
app.use(serveStatic(__dirname + '/public', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
}
}));
var port = process.env.port || 1337;
app.listen(port, function () {
console.log('Listening on http://localhost:' + port);
});