Configurable back-end port

This commit is contained in:
Raffson
2024-02-10 17:58:44 +01:00
parent 63d05ea696
commit cb68ff0df3
8 changed files with 62 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
from functools import lru_cache
from typing import Optional
from pydantic_settings import BaseSettings
@@ -30,5 +31,5 @@ class ServerSettings(BaseSettings):
@classmethod
@lru_cache
def get(cls) -> ServerSettings:
return cls()
def get(cls, port: Optional[int] = server_port) -> ServerSettings:
return cls(server_port=port)