diff options
| author | user <user@node5.net> | 2024-04-07 03:03:16 +0200 |
|---|---|---|
| committer | user <user@node5.net> | 2024-04-07 03:03:16 +0200 |
| commit | 0ead8a6c32e55fb2989e932ff0d5a20f88809fd9 (patch) | |
| tree | c7832f3a2f601e2f4f57b1914dde80888bd253dc /src/shop_map_node5_net.py | |
| parent | fa360829bfe3f04f3e6d9af196dc9fd480864d4b (diff) | |
show all stores, and their respective polygons
Diffstat (limited to 'src/shop_map_node5_net.py')
| -rw-r--r-- | src/shop_map_node5_net.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shop_map_node5_net.py b/src/shop_map_node5_net.py index 5154a0d..eafad5c 100644 --- a/src/shop_map_node5_net.py +++ b/src/shop_map_node5_net.py @@ -1,10 +1,10 @@ import json +import os import flask import db_handler - app = flask.Flask(__name__, template_folder='templates', static_folder='static', static_url_path='') @@ -13,6 +13,14 @@ def index(): return flask.redirect('/index.html') +@app.route("/chains") +def chains(): + icons = os.listdir(os.path.join(os.getcwd(), 'src', 'static', 'icons')) + icons.pop(icons.index('Unknown.png')) + chains = [os.path.splitext(a)[0] for a in icons] + return json.dumps(chains) + + @app.route("/supermarkets.json") def supermarkets(): return db_handler.get_supermarkets() |
