diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-17 00:10:40 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-20 13:40:05 +0100 |
| commit | 82ed960aa540481cecc342716118fb74d349e900 (patch) | |
| tree | 2ca8862d4868369d4fbd7d8db311a9b2f890bee5 /server.py | |
| parent | 10e3d6874745283b545d3b8029a3e5e184932c5d (diff) | |
| download | tdde25-load-file.tar.gz | |
load file with name via formload-file
Diffstat (limited to 'server.py')
| -rw-r--r-- | server.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -10,8 +10,6 @@ nodes = None @get('/') def index(): - global nodes - nodes = store.extract_osm_nodes("university.osm") return read_html('templates/index.html') @@ -36,4 +34,13 @@ def shortest_path(body): return json.dumps(response) +@post("/load-file") +def load_osm(body): + global nodes + body = json.loads(body) + print(body) + nodes = store.extract_osm_nodes(body["filename"]) + return "" + + run_server() |
