Browse Source

fix: proxy api request

Yidadaa 1 year ago
parent
commit
eec1dd6448
2 changed files with 7 additions and 2 deletions
  1. 4 1
      app/api/config/route.ts
  2. 3 1
      next.config.mjs

+ 4 - 1
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";

+ 3 - 1
next.config.mjs

@@ -16,7 +16,9 @@ const nextConfig = {
       });
     }
 
-    return ret;
+    return {
+      afterFiles: ret,
+    };
   },
   webpack(config) {
     config.module.rules.push({