feat: 环境变量配置

This commit is contained in:
martsforever
2026-03-28 21:31:52 +08:00
parent c2eef126cd
commit 927230848e
6 changed files with 70 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
from pydantic_settings import BaseSettings
from pydantic import Field
class EnvSettings(BaseSettings):
server_port: int = Field(..., env="SERVER_PORT")
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
env = EnvSettings()