Flask now serves the frontend
Some checks failed
continuous-integration/drone the build failed

This commit is contained in:
Jef Roosens 2021-05-18 22:06:37 +02:00
parent f5b443d271
commit 0d693847b1
Signed by: Jef Roosens
GPG key ID: 955C0660072F691F
3 changed files with 22 additions and 14 deletions

View file

@ -1,13 +1,13 @@
"""Main entrypoint for the program."""
from quart import Quart
app = Quart("jos")
app = Quart("jos", static_folder="web/dist", static_url_path="/")
@app.route("/")
async def hello():
"""Placeholder route."""
return "hello"
@app.route('/', methods=['GET'], defaults={'path': ''})
@app.route('/<path:path>', methods=['GET'])
async def frontend(path):
return await app.send_static_file("index.html")
app.run(host="0.0.0.0")