修改 .env.example,优化API配置说明并明确线上环境要求。更新多语言错误提示,确保用户在未启用API代理时获得清晰反馈。重构API代理逻辑,移除开发代理文件,简化代码结构,提升可维护性。
17 lines
466 B
TypeScript
17 lines
466 B
TypeScript
import { type NextRequest } from "next/server";
|
|
|
|
import { proxyLotteryApi } from "@/lib/lottery-api-proxy";
|
|
|
|
type RouteContext = { params: Promise<{ path: string[] }> };
|
|
|
|
async function handle(request: NextRequest, context: RouteContext) {
|
|
const { path } = await context.params;
|
|
return proxyLotteryApi(request, path);
|
|
}
|
|
|
|
export const GET = handle;
|
|
export const POST = handle;
|
|
export const PUT = handle;
|
|
export const PATCH = handle;
|
|
export const DELETE = handle;
|