diff options
Diffstat (limited to 'server.py')
| -rw-r--r-- | server.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -11,7 +11,9 @@ nodes = None @get('/') def index(): global nodes - nodes = store.extract_osm_nodes("university.osm") + global unconnected_nodes + nodes, unconnected_nodes = store.extract_osm_nodes("university.osm") + return read_html('templates/index.html') @@ -23,6 +25,12 @@ def show_area(): return json.dumps(rect) +@get('/show-unconnected-nodes') +def show_unconnected_nodes(): + print(f"Showing {len(unconnected_nodes)} unconnected nodes") + return json.dumps({node.id: node.coord_tuple() for node in unconnected_nodes}) + + @post('/shortest-path') def shortest_path(body): body = json.loads(body) |
