From 083d77e252c665ab3b36aafd0e983b39b1162051 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Thu, 7 May 2026 21:22:30 +0700 Subject: [PATCH] fix: migrate proxy handler logic from pages/api/proxy.ts to app/api/proxy/route.ts and remove old file --- pages/api/proxy.ts => app/api/proxy/route.ts | 12 ++++++++---- next.config.ts | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) rename pages/api/proxy.ts => app/api/proxy/route.ts (84%) diff --git a/pages/api/proxy.ts b/app/api/proxy/route.ts similarity index 84% rename from pages/api/proxy.ts rename to app/api/proxy/route.ts index ee6fe4c..a4f50ae 100644 --- a/pages/api/proxy.ts +++ b/app/api/proxy/route.ts @@ -6,9 +6,7 @@ import { isAllowedTarget, } from "@/lib/relay-utils"; -export const config = { - runtime: 'edge', -}; +export const runtime = "edge"; async function handler(req: Request): Promise { const ALLOWED_METHODS = new Set(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]); @@ -51,4 +49,10 @@ async function handler(req: Request): Promise { 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; diff --git a/next.config.ts b/next.config.ts index 660b5c7..77c86ad 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,6 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { - trailingSlash: false, }; export default nextConfig;