2025 SSF Public

This commit is contained in:
janghanul090801 2025-09-12 14:47:48 +09:00
commit 76a02076c9
192 changed files with 5016 additions and 0 deletions

21
Backend/router/router.py Normal file
View file

@ -0,0 +1,21 @@
import os
import traceback
from fastapi import APIRouter
from fastapi.logger import logger
router = APIRouter()
for router_file in os.listdir("Backend/router/endpoints"):
try:
if router_file.endswith(".py"):
module_name = "Backend.router.endpoints." + router_file[:-3]
module = __import__(module_name, fromlist=[""])
router_object = getattr(module, "router")
prefix = getattr(module, "prefix", router_file[:-3])
router.include_router(router_object, prefix="/api", tags=[router_file[:-3]])
print(f"Loaded router: /api/{prefix} - {router_file}")
except Exception as e:
logger.error(f"Error loading router {router_file}:\n{traceback.format_exc()}")