Files
ClassHelper/packages/server/.env.example
T

40 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ---------------------------------------------------------------------------
# 班级小助手 - 后端服务环境变量
# 复制为 .env 后按需修改:cp .env.example .env
# ---------------------------------------------------------------------------
# 运行环境:development | test | production
NODE_ENV=development
# HTTP / WebSocket 监听端口
PORT=4000
# 数据库类型:sqlite | mysql
# 说明:sqlite 用于本地开发;mysql 用于云端统一存储(见 docs/mysql.md)
DATABASE_PROVIDER=sqlite
# SQLite:相对路径以 packages/server 为基准
DATABASE_URL="file:./prisma/dev.db"
# MySQL 示例(切换时替换上面一行,并执行 pnpm db:switch:mysql):
# DATABASE_URL="mysql://classhelper:your-password@127.0.0.1:3306/classhelper"
# JWT 签名密钥:必须修改,建议 `node -e "console.log(require('crypto').randomBytes(48).toString('hex'))"`
JWT_SECRET=change-me-to-a-random-48-bytes-hex-string
# JWT 有效期,例如 7d / 12h
JWT_EXPIRES_IN=7d
# 允许跨域的来源,多个用英文逗号分隔;* 表示全部允许(开发环境)
CORS_ORIGIN=*
# bcrypt 加密强度
BCRYPT_ROUNDS=10
# 教师新增学生账号时未指定密码所使用的初始密码
DEFAULT_STUDENT_PASSWORD=123456
# 学期配置:第 1 教学周的周一日期(YYYY-MM-DD),用于“当前周次”换算
TERM_START_DATE=2026-02-23
# 日志级别:debug | info | warn | error
LOG_LEVEL=info