2121from app .routers .selenium_proxy import router as selenium_proxy_router
2222from app .services .selenium_hub import SeleniumHub
2323
24- SETTINGS = get_settings ()
24+ settings = get_settings ()
2525MCP_HTTP_PATH = "/mcp"
2626MCP_SSE_PATH = "/sse"
2727
@@ -37,7 +37,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, Any]:
3737 app .state .browsers_instances_lock = asyncio .Lock ()
3838
3939 # Initialize Selenium Hub singleton
40- hub = SeleniumHub (SETTINGS ) # This will create or return the singleton instance
40+ hub = SeleniumHub (settings ) # This will create or return the singleton instance
4141
4242 # Ensure hub is running and healthy before starting the application
4343 try :
@@ -61,19 +61,19 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, Any]:
6161 hub .cleanup ()
6262
6363 app = FastAPI (
64- title = SETTINGS .PROJECT_NAME ,
65- version = SETTINGS .VERSION ,
66- description = SETTINGS .DESCRIPTION ,
64+ title = settings .PROJECT_NAME ,
65+ version = settings .VERSION ,
66+ description = settings .DESCRIPTION ,
6767 lifespan = lifespan ,
6868 )
6969
7070 Instrumentator ().instrument (app )
7171
7272 # CORS middleware
73- if SETTINGS .BACKEND_CORS_ORIGINS :
73+ if settings .BACKEND_CORS_ORIGINS :
7474 app .add_middleware (
7575 CORSMiddleware ,
76- allow_origins = [str (origin ) for origin in SETTINGS .BACKEND_CORS_ORIGINS ],
76+ allow_origins = [str (origin ) for origin in settings .BACKEND_CORS_ORIGINS ],
7777 allow_credentials = True ,
7878 allow_methods = ["*" ],
7979 allow_headers = ["*" ],
@@ -96,7 +96,7 @@ async def health_check(
9696 is_healthy = await hub .check_hub_health ()
9797 return HealthCheckResponse (
9898 status = HealthStatus .HEALTHY if is_healthy else HealthStatus .UNHEALTHY ,
99- deployment_mode = SETTINGS .DEPLOYMENT_MODE ,
99+ deployment_mode = settings .DEPLOYMENT_MODE ,
100100 )
101101
102102 # Stats endpoint
@@ -120,22 +120,22 @@ async def get_hub_stats(
120120 return HubStatusResponse (
121121 hub_running = is_running ,
122122 hub_healthy = is_healthy ,
123- deployment_mode = SETTINGS .DEPLOYMENT_MODE ,
124- max_instances = SETTINGS .selenium_grid .MAX_BROWSER_INSTANCES ,
123+ deployment_mode = settings .DEPLOYMENT_MODE ,
124+ max_instances = settings .selenium_grid .MAX_BROWSER_INSTANCES ,
125125 browsers = app_state .browsers_instances ,
126126 webdriver_remote_url = hub .WEBDRIVER_REMOTE_URL ,
127127 )
128128
129129 # Include browser management endpoints
130- app .include_router (browsers_router , prefix = SETTINGS .API_V1_STR )
130+ app .include_router (browsers_router , prefix = settings .API_V1_STR )
131131 # Include Selenium Hub proxy endpoints
132132 app .include_router (selenium_proxy_router )
133133
134134 # --- MCP Integration ---
135135 mcp = FastApiMCP (
136136 app ,
137- name = SETTINGS .PROJECT_NAME ,
138- description = SETTINGS .DESCRIPTION ,
137+ name = settings .PROJECT_NAME ,
138+ description = settings .DESCRIPTION ,
139139 describe_full_response_schema = True ,
140140 describe_all_responses = True ,
141141 auth_config = AuthConfig (
0 commit comments