feat: Add service worker
All checks were successful
Build Docker / BuildImage (push) Successful in 49s
All checks were successful
Build Docker / BuildImage (push) Successful in 49s
This commit is contained in:
10
server.py
10
server.py
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user