-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
29 lines (22 loc) · 708 Bytes
/
app.py
File metadata and controls
29 lines (22 loc) · 708 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
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import treasure_router
from core.db import Base, engine
huntreasure = FastAPI(title="Huntreasure API", debug=True)
huntreasure.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
Base.metadata.create_all(bind=engine)
huntreasure.include_router(treasure_router.router)
# 실행 명령어 디버깅용
# uvicorn app:huntreasure --reload
# --host 0.0.0.0 --port 80
# 파이썬 코드로 실행시
# if __name__ == "__main__":
# uvicorn.run(fastapi_app
# , host = "0.0.0.0"
# , port = 80)