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-19 12:07:23 +02:00
|
|
|
from app.api import api_bp
|
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-19 12:07:23 +02:00
|
|
|
app.register_blueprint(api_bp, url_prefix="/api")
|
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")
|