Created
October 30, 2019 18:18
-
-
Save gaboelnuevo/4fe95aa03462a76b7209f65e8622bc92 to your computer and use it in GitHub Desktop.
Static
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
app.use( | |
express.static("dist"), { | |
maxAge: 0, | |
etag: false, | |
setHeaders: function(res: any, path: any, stat: any) { | |
res.set("Cache-Control", "private, no-cache, no-store, must-revalidate"); | |
res.set("Expires", "-1"); | |
res.set("Pragma", "no-cache"); | |
} | |
}) | |
); | |
const port = process.env.PORT || 8080; | |
app.listen(port, () => | |
console.log(`App is listening on port ${port}.`) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment