Files
juwan-frontend/next.config.ts
T
zetaloop a3f0b49112 feat(chat): implement WebSocket chat client with useChatSocket hook
Replace the stubbed chat API with a real WebSocket hook that
connects to /ws/chat and supports DM creation, messaging,
session join/leave, and history retrieval. Keep REST stub
functions for backward compatibility with existing pages
that require listChatSessions/getChatSessionById imports.
2026-05-01 17:33:29 +08:00

26 lines
539 B
TypeScript

import type { NextConfig } from "next"
const nextConfig: NextConfig = {
async rewrites() {
// 仅在开发环境启用 API 代理
if (process.env.NODE_ENV !== "development") {
return []
}
const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || "http://localhost:18080"
return [
{
source: "/api/:path*",
destination: `${backendUrl}/api/:path*`,
},
{
source: "/healthz",
destination: `${backendUrl}/healthz`,
},
]
},
}
export default nextConfig