백엔드 프레임 설계

This commit is contained in:
HyeongBaeYang committed 2026-06-15 15:53:39 +09:00
1 parent d264104077
commit f7833ba466
62 files changed
+1397

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
# 실행 방법
# pip install -r requirements.txt
# python web_main.py # 기본 local 환경
# APP_ENV=dev python web_main.py # 환경 지정
#
# 또는 uvicorn 직접 실행:
# uvicorn router.router:app --reload --host=0.0.0.0 --port=9300
import uvicorn
from common.logger import LOG
from config.server_configs import web_server_config
LOG.SetPrefix(web_server_config.server_name)
# import 시점에 app 및 DB 세션 매니저(싱글톤)가 초기화된다.
import router.router
if __name__ == "__main__":
LOG.i(f"Server Name : {web_server_config.server_name}")
LOG.i(f"Server Port : {web_server_config.port}")
LOG.i(f"API Server start time : {router.router.API_SERVER_START_TIME}")
if web_server_config.is_ssl:
uvicorn.run(
"router.router:app",
host="0.0.0.0",
port=web_server_config.port,
access_log=False,
workers=web_server_config.process_count,
ssl_keyfile="./SSL/key.pem",
ssl_certfile="./SSL/cert.pem",
)
else:
uvicorn.run(
"router.router:app",
host="0.0.0.0",
port=web_server_config.port,
access_log=False,
workers=web_server_config.process_count,
)