Skip to content

Commit 87481aa

Browse files
committed
fix: move create_all to startup event
1 parent 4c0ea33 commit 87481aa

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

app/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
from app.database import Base, engine, get_db
88
from app.schemas import URLCreate, URLResponse, URLStats
99

10-
Base.metadata.create_all(bind=engine)
11-
1210
app = FastAPI(title="URL Shortener", version="1.0.0")
1311

1412

1513
@app.on_event("startup")
1614
def startup():
1715
Base.metadata.create_all(bind=engine)
1816

17+
1918
@app.get("/health")
2019
def health_check():
2120
return {"status": "ok"}

0 commit comments

Comments
 (0)