www_site/next.config.ts

15 lines
548 B
TypeScript
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.

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
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;