16 lines
304 B
Python
16 lines
304 B
Python
from fastapi import FastAPI
|
|
from models import Base
|
|
from database import engine
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.on_event("startup")
|
|
async def startup():
|
|
async with engine.begin() as conn:
|
|
await conn.run_sync(Base.metadata.create_all)
|
|
|
|
|
|
@app.get("/")
|
|
def read_root():
|
|
return {"status": "running"}
|