fix: migrate proxy handler logic from pages/api/proxy.ts to app/api/proxy/route.ts and remove old file

This commit is contained in:
MythEclipse
2026-05-07 21:22:30 +07:00
parent 52845da832
commit 083d77e252
2 changed files with 8 additions and 5 deletions
@@ -6,9 +6,7 @@ import {
isAllowedTarget, isAllowedTarget,
} from "@/lib/relay-utils"; } from "@/lib/relay-utils";
export const config = { export const runtime = "edge";
runtime: 'edge',
};
async function handler(req: Request): Promise<Response> { async function handler(req: Request): Promise<Response> {
const ALLOWED_METHODS = new Set(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]); const ALLOWED_METHODS = new Set(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]);
@@ -51,4 +49,10 @@ async function handler(req: Request): Promise<Response> {
return createRelayResponse(response); return createRelayResponse(response);
} }
export default handler; export const GET = handler;
export const POST = handler;
export const PUT = handler;
export const DELETE = handler;
export const PATCH = handler;
export const HEAD = handler;
export const OPTIONS = handler;
-1
View File
@@ -1,7 +1,6 @@
import type { NextConfig } from 'next'; import type { NextConfig } from 'next';
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
trailingSlash: false,
}; };
export default nextConfig; export default nextConfig;