Files
rill/config.yaml
T
2026-09-17 12:50:54 +08:00

41 lines
1.1 KiB
YAML

# rill 服务端配置
server:
host: "0.0.0.0" # 监听地址,0.0.0.0 表示所有网卡
port: 8080
mode: debug # gin 运行模式: debug / release / test
log:
level: info # 日志级别: debug / info / warn / error
access_log: true # 是否输出 HTTP 访问日志
static:
dir: "./dist" # 前端构建产物目录
api:
prefix: "/api" # API 路由前缀
cors:
enabled: true
allow_origins:
- "http://localhost:5173" # Vite 开发服务器地址
allow_methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
allow_headers: ["Origin", "Content-Type", "Accept", "Authorization"]
allow_credentials: false
max_age: "12h"
# 数据库(当前仅配置,服务暂不建立连接)
database:
driver: sqlite3 # sqlite3 / mysql
connect_timeout: "10s" # 建立连接超时
sqlite:
path: "./data/rill.db"
mysql:
host: "127.0.0.1"
port: 3306
user: "root"
password: "" # 允许留空
database: "rill"
charset: "utf8mb4"
max_open_conns: 10
max_idle_conns: 5
conn_max_lifetime: "1h"