chongming/config.toml

86 lines
1.7 KiB
TOML
Raw Permalink Normal View History

2026-01-26 09:50:55 +08:00
[default]
app.name = "FastAPI Chongming Demo"
app.version = "1.0.0"
app.description = "基于 FastAPI 和 Tortoise-ORM 的 chongming 打包脚手架"
app.debug = false
env = "production"
[server]
host = "0.0.0.0"
port = 8000
reload = false
workers = 4
[database]
url = "sqlite://db.sqlite3"
# PostgreSQL 示例: "postgres://user:pass@localhost:5432/dbname"
# MySQL 示例: "mysql://user:pass@localhost:3306/dbname"
generate_schemas = true # 生产环境使用迁移工具
[security]
secret_key = "your-secret-key-change-in-production"
algorithm = "HS256"
access_token_expire_minutes = 30
[development]
env = "development"
debug = true
[development.server]
host = "127.0.0.1"
port = 8000
reload = true
workers = 1
[development.database]
url = "sqlite://dev.db"
generate_schemas = true
[development.logging]
level = "DEBUG"
file = "logs/dev.log"
[development.cors]
allow_origins = ["*"]
allow_credentials = true
allow_methods = ["*"]
allow_headers = ["*"]
[production]
env = "production"
debug = false
[production.server]
host = "0.0.0.0"
port = 8000
reload = false
workers = 4
[production.database]
url = "sqlite://prod.db"
generate_schemas = true
[production.logging]
level = "INFO"
file = "logs/prod.log"
[production.cors]
allow_origins = ["https://yourdomain.com"]
allow_credentials = true
allow_methods = ["GET", "POST", "PUT", "DELETE"]
allow_headers = ["Authorization", "Content-Type"]
[production.module_system]
type = "module-bank"
path = ["resources/app.mbank", "resources/plugins.mbank"]
[production.file_system]
type = "svfs"
path = "resources/application.vfs"
[redis]
enabled = false
url = "redis://localhost:6379"
[cache]
default_ttl = 300