27 lines
561 B
Python
27 lines
561 B
Python
from fastapi import FastAPI
|
|
from data.db import engine, Base
|
|
|
|
from app.connections import connections_router
|
|
from app.users import users_router
|
|
|
|
app = FastAPI()
|
|
|
|
app.include_router(router=users_router, prefix="/users", tags=["Users"])
|
|
app.include_router(
|
|
router=connections_router, prefix="/connections", tags=["Connections"]
|
|
)
|
|
|
|
|
|
# @app.on_event("startup")
|
|
async def startup():
|
|
async with engine.begin() as conn:
|
|
await conn.run_sync(Base.metadata.create_all)
|
|
|
|
|
|
# import asyncio
|
|
# asyncio.run(startup())
|
|
|
|
# import uvicorn
|
|
|
|
# uvicorn.run(app=app)
|