mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 19:11:00 +00:00
add fastapi driver, config
This commit is contained in:
29
nonebot/config.py
Normal file
29
nonebot/config.py
Normal file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from typing import Set, Union
|
||||
from ipaddress import IPv4Address
|
||||
|
||||
from pydantic import BaseSettings
|
||||
|
||||
|
||||
class Env(BaseSettings):
|
||||
environment: str = "prod"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
|
||||
class Config(BaseSettings):
|
||||
driver: str = "nonebot.drivers.fastapi"
|
||||
host: IPv4Address = IPv4Address("127.0.0.1")
|
||||
port: int = 8080
|
||||
debug: bool = False
|
||||
|
||||
superusers: Set[int] = set()
|
||||
nickname: Union[str, Set[str]] = ""
|
||||
|
||||
custom_config: dict = {}
|
||||
|
||||
class Config:
|
||||
env_file = ".env.prod"
|
Reference in New Issue
Block a user