Files
forumlify/next.config.js
T
lezi-fun 8e538fea80 chore: allowedDevOrigins reads ALLOWED_DEV_ORIGINS env (no hardcoded IPs)
Dev-only origin allowlist stays 127.0.0.1 by default; LAN devices can
be enabled per-machine via ALLOWED_DEV_ORIGINS=ip1,ip2 without touching
the repo.
2026-08-11 19:40:52 +08:00

20 lines
794 B
JavaScript
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.
/** @type {import('next').NextConfig} */
const nextConfig = {
// 本地开发允许的来源:默认本机;局域网/其他设备通过环境变量追加
// ALLOWED_DEV_ORIGINS=192.168.x.x,10.0.0.x (仅开发用,不写死具体 IP)
allowedDevOrigins: [
'127.0.0.1',
...(process.env.ALLOWED_DEV_ORIGINS ? process.env.ALLOWED_DEV_ORIGINS.split(',').map((s) => s.trim()) : []),
],
// Docker 部署用 standalone 输出;serverless(Vercel/CF Pages)不需要
...(process.env.DOCKER ? { output: 'standalone' } : {}),
// /uploads/* 由 API 路由提供(上传文件运行时新增,不进 public 构建快照)
async rewrites() {
return [
{ source: '/uploads/:name', destination: '/api/uploads/:name' },
];
},
};
module.exports = nextConfig;