unsupport MS Edge (for now, sorry) and some http header nits
This commit is contained in:
parent
b703f78db9
commit
2e233da16d
5 changed files with 13 additions and 4 deletions
|
@ -11,16 +11,17 @@ if (config.sentry_dsn) {
|
|||
|
||||
const app = express();
|
||||
|
||||
routes(app);
|
||||
|
||||
app.use(
|
||||
express.static(path.resolve(__dirname, '../dist/'), {
|
||||
setHeaders: function(res) {
|
||||
res.set('Cache-Control', 'public, max-age=31536000, immutable');
|
||||
res.removeHeader('Pragma');
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
routes(app);
|
||||
|
||||
app.use(pages.notfound);
|
||||
|
||||
app.listen(config.listen_port);
|
||||
|
|
|
@ -51,6 +51,11 @@ module.exports = function(app) {
|
|||
}
|
||||
})
|
||||
);
|
||||
app.use(function(req, res, next) {
|
||||
res.set('Pragma', 'no-cache');
|
||||
res.set('Cache-Control', 'no-cache');
|
||||
next();
|
||||
});
|
||||
app.use(bodyParser.json());
|
||||
app.get('/', pages.index);
|
||||
app.get('/legal', pages.legal);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue