From c9539ed816831b84d6f73c339909f04e3f5953ca Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 12 Feb 2020 16:40:14 +0000 Subject: [PATCH] Try serving eV as a static directory --- .gitattributes | 1 + openflexure_microscope/api/app.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..5f08879f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +openflexure_microscope/api/static/** filter=lfs diff=lfs merge=lfs -text diff --git a/openflexure_microscope/api/app.py b/openflexure_microscope/api/app.py index ce0d1068..2d15f673 100644 --- a/openflexure_microscope/api/app.py +++ b/openflexure_microscope/api/app.py @@ -68,6 +68,7 @@ app, labthing = create_app( title=f"OpenFlexure Microscope {api_microscope.name}", description="Test LabThing-based API for OpenFlexure Microscope", version=pkg_resources.get_distribution("openflexure_microscope").version, + flask_kwargs={"static_url_path": ""}, ) # Enable CORS for some routes outside of LabThings @@ -120,6 +121,11 @@ for name, action in views.enabled_root_actions().items(): labthing.add_view(view_class, f"/actions{rule}") +@app.route("/") +def openflexure_ev(): + return app.send_static_file("index.html") + + @app.route("/routes") @cross_origin() def routes():