This commit is contained in:
parent
622a4038ac
commit
d4136a396a
26
manifest.json
Normal file
26
manifest.json
Normal file
@ -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"
|
||||
}
|
16
server.py
16
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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user