refactor(env, i18n, http): 更新环境配置与错误提示信息
修改 .env.example,简化 API 配置说明并明确生产环境要求。更新多语言错误提示,确保用户在未启用 API 代理时获得清晰反馈。重构 admin-http.ts,优化 API 基础 URL 的解析逻辑,提升代码可维护性。
This commit is contained in:
16
src/app/api/[...path]/route.ts
Normal file
16
src/app/api/[...path]/route.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { type NextRequest } from "next/server";
|
||||
|
||||
import { proxyLotteryApiInDev } from "@/lib/lottery-api-dev-proxy";
|
||||
|
||||
type RouteContext = { params: Promise<{ path: string[] }> };
|
||||
|
||||
async function handle(request: NextRequest, context: RouteContext) {
|
||||
const { path } = await context.params;
|
||||
return proxyLotteryApiInDev(request, path);
|
||||
}
|
||||
|
||||
export const GET = handle;
|
||||
export const POST = handle;
|
||||
export const PUT = handle;
|
||||
export const PATCH = handle;
|
||||
export const DELETE = handle;
|
||||
Reference in New Issue
Block a user