Filaments can now be created

This commit is contained in:
Donkie
2023-04-01 22:51:36 +02:00
parent 35fdd23ec0
commit 2fa91b0632
11 changed files with 246 additions and 44 deletions

View File

@@ -1,13 +1,21 @@
"""Main entrypoint to the server."""
import uvicorn
from fastapi import FastAPI
import spoolson.api.v1.router
from spoolson.api.v1.router import app as v1_app
from spoolson.database.database import setup_db
app = FastAPI()
app = FastAPI(debug=True)
app.mount("/api/v1", v1_app)
@app.on_event("startup")
async def startup() -> None:
"""Run the service's startup sequence."""
await setup_db("sqlite+aiosqlite:///./sql_app.db")
app.mount("/api/v1", spoolson.api.v1.router.app)
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)