Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stopmin committed Jul 18, 2024
2 parents 9ea15a5 + 49ff918 commit 7a4b283
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,25 @@
from app.router.send_email_service_router import send_email_service_router
from app.router.user_type_router import user_type_router
from app.service.news_scheduling_service import schedule_task
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

# CORS 설정
origins = ["*"] # 모든 출처 허용

app.add_middleware(
CORSMiddleware,
allow_origins=origins, # 모든 출처 허용
allow_credentials=True,
allow_methods=["*"], # 모든 HTTP 메소드 허용
allow_headers=["*"], # 모든 HTTP 헤더 허용
)

@app.on_event("startup")
async def startup_event():
asyncio.create_task(schedule_task())


# load env
load_dotenv()

Expand All @@ -40,7 +50,6 @@ async def startup_event():
app.add_exception_handler(Exception, exception_handler)
app.add_exception_handler(HTTPException, http_exception_handler)


@app.get("/health")
async def health_check():
return {"status": "OK"}

0 comments on commit 7a4b283

Please sign in to comment.