File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414host = settings .api .api_host
1515port = settings .api .api_port
16+ base_url = str (settings .api .base_url )
1617
1718app = create_app (routers = [])
1819
2122 lifespan = lifespan ,
2223 routers = [status_router , stateful_exchange_router ],
2324)
24- stateful_app_url = f"http:// { host } : { port } { stateful_app_path } "
25+ stateful_app_url = f"{ base_url } { stateful_app_path } "
2526app .mount (stateful_app_path , stateful_app )
2627
2728stateless_app_path = "/v1/stateless/"
2829stateless_app = create_app (
2930 routers = [status_router , stateless_exchange_router ],
3031)
31- stateless_app_url = f"http:// { host } : { port } { stateless_app_path } "
32+ stateless_app_url = f"{ base_url } { stateless_app_path } "
3233app .mount (stateless_app_path , stateless_app )
3334
3435
Original file line number Diff line number Diff line change 1- from pydantic import Field , IPvAnyAddress
1+ from pydantic import Field , HttpUrl , IPvAnyAddress
22
33from ctenex .settings .base import CommonSettings
44
@@ -8,4 +8,8 @@ class APISettings(CommonSettings):
88 validation_alias = "API_HOST" ,
99 default = IPvAnyAddress ("0.0.0.0" ), # type: ignore
1010 )
11- api_port : int = Field (validation_alias = "API_PORT" , default = 3000 )
11+ api_port : int = Field (validation_alias = "API_PORT" , default = 8000 )
12+ base_url : HttpUrl = Field (
13+ validation_alias = "BASE_URL" ,
14+ default = HttpUrl ("http://localhost:8000" ),
15+ )
Original file line number Diff line number Diff line change 11[project ]
22name = " ctenex"
3- version = " 0.1.0 "
3+ version = " 0.1.1 "
44description = " "
55authors = [
66 {name = " Your Name" ,email = " you@example.com" }
You can’t perform that action at this time.
0 commit comments