mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 12:51:45 +00:00
🐛 Fix WebServer configuration
Co-authored-by: Karako <karakohear@gmail.com>
This commit is contained in:
parent
e086820851
commit
dfe58215ae
@ -84,10 +84,9 @@ LOGGER_FILTERED_NAMES=["uvicorn","ErrorPush","ApiHelper"]
|
|||||||
# ENKA_NETWORK_API_AGENT=""
|
# ENKA_NETWORK_API_AGENT=""
|
||||||
|
|
||||||
# Web Server
|
# Web Server
|
||||||
# WEB_SWITCH=False # 是否开启
|
# WEB_ENABLE=False # 是否开启 WebServer
|
||||||
# WEB_URL=http://localhost:8080/
|
# WEB_HOST=localhost # WebServer 监听地址
|
||||||
# WEB_HOST=localhost
|
# WEB_PORT=8080 # WebServer 监听端口
|
||||||
# WEB_PORT=8080
|
|
||||||
|
|
||||||
# error
|
# error
|
||||||
# ERROR_PB_URL=https://fars.ee
|
# ERROR_PB_URL=https://fars.ee
|
||||||
|
@ -68,13 +68,17 @@ class WebServerConfig(Settings):
|
|||||||
enable: bool = False
|
enable: bool = False
|
||||||
"""是否启用WebServer"""
|
"""是否启用WebServer"""
|
||||||
|
|
||||||
url: AnyUrl = "http://localhost:8080"
|
|
||||||
host: str = "localhost"
|
host: str = "localhost"
|
||||||
port: int = 8080
|
port: int = 8080
|
||||||
|
|
||||||
class Config(Settings.Config):
|
class Config(Settings.Config):
|
||||||
env_prefix = "web_"
|
env_prefix = "web_"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def url(self) -> str:
|
||||||
|
# noinspection HttpUrlsUsage
|
||||||
|
return "http://" + self.host + ":" + str(self.port)
|
||||||
|
|
||||||
|
|
||||||
class ErrorConfig(Settings):
|
class ErrorConfig(Settings):
|
||||||
pb_url: str = ""
|
pb_url: str = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user