Controllers added updated implementations and tests awaits
This commit is contained in:
24
Controllers/Mongo/config.py
Normal file
24
Controllers/Mongo/config.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Configs(BaseSettings):
|
||||
"""
|
||||
MongoDB configuration settings.
|
||||
"""
|
||||
|
||||
USER: str = ""
|
||||
PASSWORD: str = ""
|
||||
HOST: str = ""
|
||||
PORT: int = 0
|
||||
DB: str = ""
|
||||
ENGINE: str = ""
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""Generate the database URL."""
|
||||
return f"{self.ENGINE}://{self.USER}:{self.PASSWORD}@{self.HOST}:{self.PORT}/{self.DB}?retryWrites=true&w=majority"
|
||||
|
||||
model_config = SettingsConfigDict(env_prefix="MONGO_")
|
||||
|
||||
|
||||
mongo_configs = Configs() # singleton instance of the MONGODB configuration settings
|
||||
Reference in New Issue
Block a user