diff --git a/web/app.py b/web/app.py index 4b3bb2f..8a3faaf 100644 --- a/web/app.py +++ b/web/app.py @@ -6,6 +6,7 @@ import dash_bootstrap_components as dbc from flask import Flask from werkzeug import run_simple +from werkzeug.middleware.proxy_fix import ProxyFix try: from werkzeug.middleware.dispatcher import DispatcherMiddleware @@ -40,6 +41,7 @@ def start_app(title, base_path, debug: bool, host, port, reloader=False, # pyl if unminified: locale_url = ["assets/plotly-with-meta.js"] app = Flask(__name__) + app.wsgi_app = ProxyFix(app.wsgi_app) app.config["DEBUG"] = debug if base_path == "/": application = DispatcherMiddleware(app) diff --git a/web/figures.py b/web/figures.py index eb85b0c..3ea870c 100644 --- a/web/figures.py +++ b/web/figures.py @@ -55,7 +55,7 @@ def get_figures(car: Car): lats = [42, 41] lons = [1, 2] names = ["undefined", "undefined"] - trips_map = px.line_mapbox(lat=lats, lon=lons, hover_name=names, zoom=12, mapbox_style="assets/style2.json") + trips_map = px.line_mapbox(lat=lats, lon=lons, hover_name=names, zoom=12, mapbox_style="style.json") trips_map.add_trace(go.Scattermapbox( mode="markers", marker={"symbol": "marker", "size": 20}, diff --git a/web/views.py b/web/views.py index 5a301da..53ac837 100644 --- a/web/views.py +++ b/web/views.py @@ -122,7 +122,7 @@ def get_vehicle_info(vin): STYLE_CACHE = None -@app.route("/assets/style2.json") +@app.route("/style.json") def get_style(): global STYLE_CACHE if not STYLE_CACHE: