18 lines
No EOL
463 B
Python
18 lines
No EOL
463 B
Python
from fastapi import FastAPI
|
|
from routes.items import router as items_router
|
|
from routes.trips import router as trips_router
|
|
from models import Base
|
|
from database import engine
|
|
|
|
app = FastAPI()
|
|
app.include_router(items_router)
|
|
app.include_router(trips_router)
|
|
|
|
@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"} |