Created
November 16, 2018 20:06
-
-
Save realtebo/43edd8a1b23b325e2d87290d080a0003 to your computer and use it in GitHub Desktop.
Portion of service-worker.js
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
server.get("/service-worker.js", (req, res) => { | |
// Don't cache service worker is a best practice (otherwise clients wont get emergency bug fix) | |
res.set("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate"); | |
res.set("Content-Type", "application/javascript"); | |
const filePath = join(__dirname, '.next', req.url); | |
app.serveStatic(req, res, filePath); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment