-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
39 lines (30 loc) · 887 Bytes
/
main.py
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
32
33
34
35
36
37
38
39
import os
import uvicorn
import config
from fastapi import FastAPI
from api import spelling, tag, writing
from starlette.middleware.cors import CORSMiddleware
app = FastAPI()
port = int(os.environ.get("GUIDE_PORT", 8003))
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"], # 모든 HTTP 메소드 허용
allow_headers=["*"], # 모든 HTTP 헤더 허용
)
app.include_router(spelling.router)
app.include_router(tag.router)
app.include_router(writing.router)
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=port, reload=True)
@app.get("/health/liveness")
async def liveness():
return {"status": "alive"}
@app.get("/health/readiness")
async def readiness():
return {"status": "ready"}
@app.get("/")
async def root():
return {"message": "Hello World"}