File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 11import granian
22from granian .constants import Interfaces , Loops
3+ from granian .log import LogLevels
34
45from app .settings import settings
56
1011 address = "0.0.0.0" , # noqa: S104
1112 port = settings .app_port ,
1213 interface = Interfaces .ASGI ,
13- log_level = settings .log_level ,
14+ log_level = LogLevels ( settings .log_level ) ,
1415 loop = Loops .uvloop ,
1516 ).serve ()
Original file line number Diff line number Diff line change 1- import pydantic
21import pydantic_settings
3- from granian .log import LogLevels
42from sqlalchemy .engine .url import URL
53
64
@@ -9,7 +7,7 @@ class Settings(pydantic_settings.BaseSettings):
97 service_version : str = "1.0.0"
108 service_environment : str = "local"
119 service_debug : bool = False
12- log_level : LogLevels = LogLevels . info
10+ log_level : str = " info"
1311
1412 db_driver : str = "postgresql+asyncpg"
1513 db_host : str = "db"
@@ -30,14 +28,10 @@ class Settings(pydantic_settings.BaseSettings):
3028 logging_buffer_capacity : int = 0
3129 swagger_offline_docs : bool = True
3230
33- cors_allowed_origins : list [str ] = pydantic .Field (
34- default_factory = lambda : [
35- "http://localhost:5173" ,
36- ]
37- )
38- cors_allowed_methods : list [str ] = pydantic .Field (default_factory = lambda : ["" ])
39- cors_allowed_headers : list [str ] = pydantic .Field (default_factory = lambda : ["" ])
40- cors_exposed_headers : list [str ] = pydantic .Field (default_factory = list )
31+ cors_allowed_origins : list [str ] = ["http://localhost:5173" ]
32+ cors_allowed_methods : list [str ] = ["" ]
33+ cors_allowed_headers : list [str ] = ["" ]
34+ cors_exposed_headers : list [str ] = []
4135
4236 @property
4337 def db_dsn (self ) -> URL :
You can’t perform that action at this time.
0 commit comments