diff options
author | BonfaceKilz | 2021-07-26 13:22:38 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-08-03 15:49:50 +0300 |
commit | f5b0a59a41b1cf3b29557aa918b217b0749879b8 (patch) | |
tree | a9284124721a778360fbb6b170ba0a1b2dbe489e | |
parent | 5e61c115a2c2be351c16fd9d1a764faecd8591fa (diff) | |
download | genenetwork2-f5b0a59a41b1cf3b29557aa918b217b0749879b8.tar.gz |
wqflask: views: Return the json data for viewing
* wqflask/wqflask/views.py (display_file): New function.
-rw-r--r-- | wqflask/wqflask/views.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 1d50bdff..12b47ce9 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1426,3 +1426,9 @@ def approve_data(name): f"{name}.approved")) return redirect("/data/approve/") + +@app.route("/display-file/<name>") +def display_file(name): + with open(os.path.join("/tmp/sample-data/diffs", name), 'r') as myfile: + content = myfile.read() + return Response(content, mimetype='text/json') |