feat: Add service worker
All checks were successful
Build Docker / BuildImage (push) Successful in 49s

This commit is contained in:
2025-01-29 18:51:28 +11:00
parent d4136a396a
commit 8ccbe2ebf1
4 changed files with 65 additions and 5 deletions

View File

@@ -237,18 +237,20 @@ def manifest():
host = request.host
# Read as json
with open("manifest.json") as file:
with open("pwa/manifest.json") as file:
manifest = json.load(file)
url = f"https://{host}"
if host == "localhost:5000" or host == "127.0.0.1:5000":
url = "http://127.0.0.1:5000"
manifest["start_url"] = url
manifest["scope"] = url
manifest["scope"] = url
return jsonify(manifest)
@app.route("/sw.js")
def pw():
return send_from_directory("pwa", "sw.js")
# region Sol Links
@app.route("/actions.json")