43 lines
1.6 KiB
Plaintext
43 lines
1.6 KiB
Plaintext
# EnGin 项目开发环境配置模板
|
||
# 使用方式:复制为 config.yaml 并填入真实值
|
||
# cp configs/config.yaml.dev configs/config.yaml
|
||
|
||
# Web 服务配置
|
||
server:
|
||
port: 8080 # 服务监听的端口
|
||
mode: "debug" # 运行模式:debug (开发模式,带控制台彩色日志) / release (生产模式,只输出 JSON 日志)
|
||
version: 2.0.4
|
||
allow_origins:
|
||
- http://localhost:3000
|
||
|
||
database:
|
||
driver: "postgres" # 驱动,支持 mysql 或 postgres
|
||
host: "127.0.0.1" # 数据库主机地址
|
||
port: 5432 # 端口号:MySQL 默认 3306,PostgreSQL 默认 5432
|
||
user: "your_user" # 用户名
|
||
password: "your_password" # 密码
|
||
dbname: "your_db" # 数据库名
|
||
|
||
# Zap 日志配置
|
||
logger:
|
||
prefix: "myproject" # 日志前缀
|
||
level: "debug" # 日志记录级别:debug, info, warn, error
|
||
filename: "./logs/app.log" # 日志输出路径 (会自动创建文件夹)
|
||
max_size: 100 # 单个日志文件最大大小 (单位: MB)
|
||
max_backups: 7 # 最多保留的旧日志文件个数
|
||
max_age: 30 # 旧日志文件最长保留天数 (单位: 天)
|
||
compress: true # 是否对历史归档日志进行 gzip 压缩
|
||
|
||
jwt:
|
||
issuer: "your_issuer"
|
||
access_secret: "your-access-secret-here"
|
||
refresh_secret: "your-refresh-secret-here"
|
||
access_expire: 2 # 小时
|
||
refresh_expire: 168 # 小时(7天)
|
||
|
||
# Redis 缓存配置
|
||
redis:
|
||
addr: "127.0.0.1:6379" # Redis 连接地址
|
||
password: "" # Redis 密码 (没有则为空)
|
||
db: 0 # 数据库编号
|