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:
@@ -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,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user