From 9fef5adfb1bf38c7c64d1e4c4f92ff885e9670ce Mon Sep 17 00:00:00 2001 From: Matthew Volk Date: Mon, 17 Jun 2024 12:49:24 -0500 Subject: [PATCH] feat: add makeswift api handler --- app/api/makeswift/[...makeswift]/route.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/api/makeswift/[...makeswift]/route.ts diff --git a/app/api/makeswift/[...makeswift]/route.ts b/app/api/makeswift/[...makeswift]/route.ts new file mode 100644 index 0000000..b754915 --- /dev/null +++ b/app/api/makeswift/[...makeswift]/route.ts @@ -0,0 +1,12 @@ +import { MakeswiftApiHandler } from '@makeswift/runtime/next/server'; +import { strict } from 'assert'; + +import { runtime } from '~/makeswift/runtime'; + +strict(process.env.MAKESWIFT_SITE_API_KEY, 'MAKESWIFT_SITE_API_KEY is required'); + +const handler = MakeswiftApiHandler(process.env.MAKESWIFT_SITE_API_KEY, { + runtime, +}); + +export { handler as GET, handler as POST };