From d84ab53e02fa1da7dd50e45def436f25ef8c3e5d Mon Sep 17 00:00:00 2001 From: Ray <22254748+rayokamoto@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:42:31 +1030 Subject: [PATCH 1/2] chore: Configure edge runtime for API routes --- src/app/api/member/route.ts | 2 ++ src/app/api/payment/route.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/app/api/member/route.ts b/src/app/api/member/route.ts index 3ccf4e32..461ef96a 100644 --- a/src/app/api/member/route.ts +++ b/src/app/api/member/route.ts @@ -4,6 +4,8 @@ import { currentUser } from '@clerk/nextjs'; import { createInsertSchema } from 'drizzle-zod'; import { z } from 'zod'; +export const runtime = 'edge'; + export async function POST(request: Request) { const req = await request.json(); const schema = createInsertSchema(memberTable, { diff --git a/src/app/api/payment/route.ts b/src/app/api/payment/route.ts index 2f000969..793d1e8e 100644 --- a/src/app/api/payment/route.ts +++ b/src/app/api/payment/route.ts @@ -17,6 +17,8 @@ import type { CreatePaymentLinkRequest } from 'square'; import { ApiError } from 'square'; import { z } from 'zod'; +export const runtime = 'edge'; + // Create a Square payment link // See: https://developer.squareup.com/reference/square/checkout-api/create-payment-link export async function POST(request: Request) { From c75f40d721d51927d2411e1d4ba00c06c0617292 Mon Sep 17 00:00:00 2001 From: Ray <22254748+rayokamoto@users.noreply.github.com> Date: Tue, 20 Feb 2024 09:52:12 +1030 Subject: [PATCH 2/2] chore: remove /api/member from edge runtime --- src/app/api/member/route.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/api/member/route.ts b/src/app/api/member/route.ts index 461ef96a..3ccf4e32 100644 --- a/src/app/api/member/route.ts +++ b/src/app/api/member/route.ts @@ -4,8 +4,6 @@ import { currentUser } from '@clerk/nextjs'; import { createInsertSchema } from 'drizzle-zod'; import { z } from 'zod'; -export const runtime = 'edge'; - export async function POST(request: Request) { const req = await request.json(); const schema = createInsertSchema(memberTable, {