From ba99f09304c0ec9b738d6e8941d781f66bbd0ba9 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 15 Dec 2023 00:08:34 -0500 Subject: [PATCH] Add service worker and offline page --- src/libpoketube/init/pages-static.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libpoketube/init/pages-static.js b/src/libpoketube/init/pages-static.js index 3ca2d6db..31467383 100644 --- a/src/libpoketube/init/pages-static.js +++ b/src/libpoketube/init/pages-static.js @@ -87,8 +87,16 @@ module.exports = function (app, config, renderTemplate) { renderTemplate(res, req, "content-settings.ejs"); }); - app.get("/manifest.json", function (req, res) { - res.sendFile("manifest.json", { root: location_pwa }); + app.get("/offline", function (req, res) { + res.sendFile("offline.html", { root: location_pwa }); + }); + + app.get("/manifest.json", function (req, res) { + res.sendFile("manifest.json", { root: location_pwa }); + }); + + app.get("/service-worker.js", function (req, res) { + res.sendFile("service-worker.js", { root: location_pwa }); });