- Replace Express server with Next.js Route Handlers (16 API routes) - Rewrite index.html SPA as React components (feed, post, admin, modals) - Move style.css to app/globals.css with dark/light themes intact - Add lib/db.js, lib/auth.js (JWT), lib/api.js (client API wrapper) - Server binds 0.0.0.0 by default; host/port configurable via config.js - Uploads served via /api/uploads route (rewrite keeps /uploads/ URLs) - Multi-stage dockerfile using standalone output
// ============================================================
|
|
// ⚙️ Forumlify 配置文件
|
|
// 自托管版本
|
|
// ============================================================
|
|
|
|
const CONFIG = {
|
|
// ===== 必填 =====
|
|
|
|
|
|
API_BASE_URL: '/api',
|
|
|
|
// ===== 可选 =====
|
|
|
|
// 论坛名称(显示在左上角)
|
|
FORUM_NAME: 'Forumlify',
|
|
|
|
// 是否开启发帖/注册的人机验证(10以内加减法)
|
|
ENABLE_CAPTCHA: true,
|
|
|
|
// 可选:服务端监听端口(仅服务端读取,浏览器端忽略)
|
|
// 优先顺序:环境变量 PORT > 此处配置 > 默认 3000
|
|
// 设为 null 则使用环境变量或默认值
|
|
SERVER_PORT: null,
|
|
|
|
// 可选:服务端监听地址(仅服务端读取,浏览器端忽略)
|
|
// 优先顺序:环境变量 HOST > 此处配置 > 默认 0.0.0.0(所有网卡)
|
|
// 设为 '127.0.0.1' 可仅本机访问;设为 '0.0.0.0' 或 null 则允许局域网访问
|
|
SERVER_HOST: null,
|
|
};
|
|
|
|
// ===== 不要修改下面 =====
|
|
if (typeof module !== 'undefined' && module.exports) module.exports = CONFIG;
|