We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fcb7bea commit c7a835fCopy full SHA for c7a835f
1 file changed
main.py.orig
@@ -0,0 +1,31 @@
1
+from fastapi import FastAPI
2
+from fastapi.middleware.cors import CORSMiddleware
3
+
4
+from database import engine, Base
5
+from routes import comments, likes
6
7
+# 테이블 자동 생성
8
+Base.metadata.create_all(bind=engine)
9
10
+app = FastAPI(title="코알라 오딧세이 Blog API", version="1.0.0"
11
12
+# CORS — Next.js 개발 서버 및 프로덕션 도메인 허용
13
+app.add_middleware(
14
+ CORSMiddleware,
15
+ allow_origins=[
16
+ "http://localhost:3000",
17
+ "http://127.0.0.1:3000",
18
+ "https://koala.ai.kr"
19
+ ],
20
+ allow_credentials=True,
21
+ allow_methods=["*"],
22
+ allow_headers=["*"],
23
+)
24
25
+app.include_router(comments.router)
26
+app.include_router(likes.router)
27
28
29
+@app.get("/health")
30
+def health():
31
+ return {"status": "ok"}
0 commit comments