File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # LOG_LEVEL=INFO
2+ # ENVIRONMENT=dev
3+
4+ # CORS Origins (쉼표로 구분)
5+ CORS_ORIGINS = https://cert.pseudo-lab.com,https://dev-cert.pseudolab-devfactory.com,http://localhost:5173
Original file line number Diff line number Diff line change @@ -40,11 +40,23 @@ def configure_logging() -> None:
4040# Access log middleware
4141app .middleware ("http" )(access_log_middleware )
4242
43- # CORS 미들웨어 설정
44- origins = os .getenv ("CORS_ORIGINS" , "" ).split ("," )
43+ # CORS configuration
44+ # Load allowed origins from CORS_ORIGINS environment variable (comma-separated)
45+ cors_origins_str = os .getenv ("CORS_ORIGINS" , "" )
46+ if cors_origins_str :
47+ origins = [origin .strip () for origin in cors_origins_str .split ("," ) if origin .strip ()]
48+ else :
49+ # Default origins for local development and known production/dev domains
50+ origins = [
51+ "http://localhost:3000" ,
52+ "http://localhost:5173" ,
53+ "https://cert.pseudo-lab.com" ,
54+ "https://dev-cert.pseudolab-devfactory.com" ,
55+ ]
56+
4557app .add_middleware (
4658 CORSMiddleware ,
47- allow_origins = [ "*" ] ,
59+ allow_origins = origins ,
4860 allow_credentials = True ,
4961 allow_methods = ["*" ],
5062 allow_headers = ["*" ],
You can’t perform that action at this time.
0 commit comments