Skip to content

Commit

Permalink
feat: basic service worker, minimum requirement for for a2hs; see #8126
Browse files Browse the repository at this point in the history
  • Loading branch information
psychobunny committed Sep 28, 2020
1 parent 31528a5 commit f69697b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routes/meta.js
Expand Up @@ -9,4 +9,8 @@ module.exports = function (app, middleware, controllers) {
app.get('/manifest.webmanifest', controllers.manifest);
app.get('/css/previews/:theme', controllers.admin.themes.get);
app.get('/osd.xml', controllers.osd.handle);
app.get('/service-worker.js', function (req, res) {
res.set('Content-Type', 'application/javascript');
res.send('self.addEventListener(\'fetch\', event => { event.respondWith( caches.match(event.request).then(response => { if (!response) { return fetch(event.request); } return response; }) ) });');
});
};

0 comments on commit f69697b

Please sign in to comment.