diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..315c841 --- /dev/null +++ b/manifest.json @@ -0,0 +1,26 @@ +{ + "short_name": "Nathan.Woodburn/", + "name": "Nathan.Woodburn/", + "icons": [ + { + "src": "https://nathan.woodburn.au/assets/img/favicon/android-chrome-192x192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "https://nathan.woodburn.au/assets/img/favicon/android-chrome-512x512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": "https://nathan.woodburn.au", + "background_color": "#000000", + "theme_color": "#000000", + "display": "fullscreen", + "orientation": "portrait", + "id": "nathanwoodburn", + "description": "Nathan.Woodburn/", + "scope": "https://nathan.woodburn.au", + "dir": "ltr", + "lang": "en" + } \ No newline at end of file diff --git a/server.py b/server.py index 4d3d106..808de22 100644 --- a/server.py +++ b/server.py @@ -235,16 +235,18 @@ def xrpLedger(): @app.route("/manifest.json") def manifest(): host = request.host - if host == "nathan.woodburn.au": - return send_from_directory("templates", "manifest.json") # Read as json - with open("templates/manifest.json") as file: + with open("manifest.json") as file: manifest = json.load(file) - if host != "localhost:5000" and host != "127.0.0.1:5000": - manifest["start_url"] = f"https://{host}/" - else: - manifest["start_url"] = "http://127.0.0.1:5000/" + 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 + + return jsonify(manifest)