feat(config): implement layered configuration using config.yaml and .env

This commit is contained in:
2026-02-12 14:41:49 +08:00
parent e01cdc9889
commit aed996f409
6 changed files with 228 additions and 87 deletions

22
config.yaml Normal file
View File

@@ -0,0 +1,22 @@
# 服务器配置
server:
port: "3000"
environment: "development"
# 数据库配置
database:
driver: "sqlite" # 可选: sqlite, postgres
sqlite:
path: "./data/database.sqlite"
postgres:
host: "localhost"
port: "5432"
user: "trace"
password: "trace123"
dbname: "trace"
sslmode: "disable"
# JWT 配置
jwt:
secret: "your-secret-key-here-change-in-production"
expire: 7200 # 过期时间(秒)