This commit is contained in:
2026-07-05 21:27:23 +09:00
parent 23d907265a
commit 3abc2edba6
83 changed files with 10351 additions and 1217 deletions
+22 -13
View File
@@ -9,29 +9,33 @@ FastAPI 애플리케이션 진입점
- 라우터 등록 (페이지별 API)
"""
import os
import sys
import logging
import os
import subprocess
import time
from pathlib import Path
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager
from pathlib import Path
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from B03_FileInput.B03_FileInput_Router import router as b03_file_input_router
from B04_wf1_Surface.B04_wf1_Surface_Router import router as b04_surface_router
from B05_wf2_Route.B05_wf2_Route_Router import router as b05_route_router
from B06_wf3_ProfileCross.B06_wf3_ProfileCross_Router import router as b06_section_router
from config.config_db import close_db_pool, init_db_pool
# 설정 import
from config.config_system import (
CORS_ORIGINS,
DEBUG,
ENVIRONMENT,
LOG_LEVEL,
SERVER_HOST,
SERVER_PORT,
DEBUG,
STATIC_DIR,
STATIC_URL,
LOG_LEVEL,
CORS_ORIGINS,
ENVIRONMENT,
)
from config.config_db import init_db_pool, close_db_pool
# 로깅 설정
logging.basicConfig(level=getattr(logging, LOG_LEVEL))
@@ -41,6 +45,7 @@ logger = logging.getLogger(__name__)
# 프론트엔드 빌드 및 서빙 함수
# ─────────────────────────────────────────────────────────────────────────
def build_frontend() -> bool:
"""프론트엔드 빌드 (npm run build from config/)"""
root_dir = Path(__file__).resolve().parent
@@ -96,7 +101,7 @@ def serve_frontend_dev() -> None:
shell=True,
cwd=str(config_dir),
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL
stderr=subprocess.DEVNULL,
)
logger.info("✓ 프론트엔드 개발 서버 백그라운드 실행")
except Exception as e:
@@ -192,6 +197,10 @@ async def health():
# app.include_router(a01_router, prefix="/api/a01", tags=["A01_Home"])
#
# 나중에 각 페이지별 라우터가 구현되면 여기에 등록.
app.include_router(b03_file_input_router)
app.include_router(b04_surface_router)
app.include_router(b05_route_router)
app.include_router(b06_section_router)
# ─────────────────────────────────────────────────────────────────────────
# 앱 실행