This repository has been archived on 2021-12-24. You can view files and clone it, but cannot push or open issues/pull-requests.
jos/app/__main__.py

18 lines
464 B
Python
Raw Normal View History

2021-05-18 23:12:00 +02:00
"""Entrypoint for the program."""
2021-05-18 11:45:44 +02:00
from quart import Quart
2021-05-18 23:12:00 +02:00
from app.api import blueprint
2021-05-18 11:45:44 +02:00
2021-05-18 22:06:37 +02:00
app = Quart("jos", static_folder="web/dist", static_url_path="/")
2021-05-18 23:12:00 +02:00
app.register_blueprint(blueprint)
2021-05-18 11:45:44 +02:00
2021-05-18 12:26:42 +02:00
2021-05-18 22:09:16 +02:00
@app.route("/", methods=["GET"], defaults={"path": ""})
@app.route("/<path:path>", methods=["GET"])
2021-05-18 22:06:37 +02:00
async def frontend(path):
2021-05-18 22:09:16 +02:00
"""Serves the Vue.js frontend."""
2021-05-18 22:06:37 +02:00
return await app.send_static_file("index.html")
2021-05-18 11:45:44 +02:00
2021-05-18 12:26:42 +02:00
2021-05-18 23:12:00 +02:00
if __name__ == "__main__":
app.run(host="0.0.0.0")