chore: 提交本地 mock TTS 代理配置与 Next.js 16 自动生成的 AGENTS/CLAUDE 说明
This commit is contained in:
parent
cee2074744
commit
74110fbe7a
9
AGENTS.md
Normal file
9
AGENTS.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!-- BEGIN:nextjs-agent-rules -->
|
||||||
|
|
||||||
|
# This is NOT the Next.js you know
|
||||||
|
|
||||||
|
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
|
||||||
|
|
||||||
|
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
|
||||||
|
|
||||||
|
<!-- END:nextjs-agent-rules -->
|
||||||
@ -2,6 +2,13 @@ import type { NextConfig } from "next";
|
|||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
|
async rewrites() {
|
||||||
|
// 设置 TTS_MOCK_UPSTREAM(见 .env.local)时,把 AI Lab 页面的 /tts/v1/* 请求代理到本地 mock TTS 服务。
|
||||||
|
// 生产环境不设置该变量,走 NEXT_PUBLIC_TTS_BASE_URL 指向真实引擎,行为不变。
|
||||||
|
const target = process.env.TTS_MOCK_UPSTREAM;
|
||||||
|
if (!target) return [];
|
||||||
|
return [{ source: "/tts/v1/:path*", destination: `${target}/v1/:path*` }];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user