From 2b9bdb6ff12a53013508414376a3de39cad4fb3e Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Thu, 25 Nov 2021 00:12:24 +0100 Subject: [PATCH] Always export obsMapSource in config.json from api --- api/obs/api/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/obs/api/app.py b/api/obs/api/app.py index ba1b4c0..8ceef73 100644 --- a/api/obs/api/app.py +++ b/api/obs/api/app.py @@ -162,10 +162,7 @@ if INDEX_HTML and exists(INDEX_HTML): **req.app.config.FRONTEND_CONFIG, "apiUrl": f"{scheme}://{req.host}{base_path}api", "loginUrl": f"{scheme}://{req.host}{base_path}login", - } - print(req.app.config) - if req.app.config.get("TILES_FILE"): - result["obsMapSource"] = { + "obsMapSource": { "type": "vector", "tiles": [ req.app.url_for("tiles", zoom="000", x="111", y="222.pbf") @@ -176,6 +173,8 @@ if INDEX_HTML and exists(INDEX_HTML): "minzoom": 12, "maxzoom": 14, } + } + return json_response(result) @app.get("/")