From eec1dd6448124830e82b59f51489f42b6d56e9fa Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Thu, 4 May 2023 22:18:03 +0800 Subject: [PATCH] fix: proxy api request --- app/api/config/route.ts | 5 ++++- next.config.mjs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/api/config/route.ts b/app/api/config/route.ts index 62b84c2e..62c8d60f 100644 --- a/app/api/config/route.ts +++ b/app/api/config/route.ts @@ -15,8 +15,11 @@ declare global { type DangerConfig = typeof DANGER_CONFIG; } -export async function POST() { +async function handle() { return NextResponse.json(DANGER_CONFIG); } +export const GET = handle; +export const POST = handle; + export const runtime = "edge"; diff --git a/next.config.mjs b/next.config.mjs index 2a96df23..25770318 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -16,7 +16,9 @@ const nextConfig = { }); } - return ret; + return { + afterFiles: ret, + }; }, webpack(config) { config.module.rules.push({