-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (20 loc) · 834 Bytes
/
main.py
File metadata and controls
31 lines (20 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from fastapi import FastAPI
from backend.app.database.db import engine, Base
from backend.app.routers import images, users, items, category, auth, cart
app = FastAPI()
Base.metadata.create_all(bind=engine)
@app.get("/")
def read():
return {"Hello": "World"}
@app.get("/hello")
def hello():
return {"I said": "Hello"}
app.include_router(users.router, prefix="/users", tags=["users"])
app.include_router(items.router, prefix="/items", tags=["items"])
app.include_router(category.router, prefix="/category", tags=["category"])
app.include_router(images.router, prefix="/images", tags=["images"])
app.include_router(auth.router, prefix="/auth", tags=["auth"])
app.include_router(cart.router, prefix="/cart", tags=["cart"])
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="127.0.0.1", port=8000)