From 21bc6d073f430f1fb9d846800664f41df710e462 Mon Sep 17 00:00:00 2001 From: CahidArda Date: Tue, 12 Nov 2024 00:51:41 +0300 Subject: [PATCH] fix: rm changes in path.ts --- examples/nextjs-pages/src/pages/api/path.ts | 30 +++------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/examples/nextjs-pages/src/pages/api/path.ts b/examples/nextjs-pages/src/pages/api/path.ts index f131204..66ce6d7 100644 --- a/examples/nextjs-pages/src/pages/api/path.ts +++ b/examples/nextjs-pages/src/pages/api/path.ts @@ -1,22 +1,12 @@ -import { Receiver } from "@upstash/qstash"; import { servePagesRouter } from "@upstash/workflow/nextjs"; -import { NextApiRequest } from "next"; const someWork = (input: string) => { return `processed '${JSON.stringify(input)}'` } -// export const config = { -// api: { -// bodyParser: false -// }, -// maxDuration: 5, -// } - - -const { handler } = servePagesRouter<{ hello: string }>( +const { handler } = servePagesRouter<{ text: string }>( async (context) => { - const input = context.requestPayload.hello + const input = context.requestPayload.text const result1 = await context.run("step1", async () => { const output = someWork(input) console.log("step 1 input", input, "output", output) @@ -28,20 +18,6 @@ const { handler } = servePagesRouter<{ hello: string }>( console.log("step 2 input", result1, "output", output) }); }, - { - receiver: new Receiver({ - currentSigningKey: "sig_7mYmu9f6mhTXU1tJtPKPtrUHgywu", - nextSigningKey: "sig_5GeRyvDD1yBfrQ1srd3c4s5tmFxR" - }) - } ) -export default async (req: NextApiRequest, res) => { - // console.log("ENV", process.env); - // console.log("HEADERS", req.headersDistinct); - console.log("BODY TYPE", typeof req.body); - // console.log("BODY", req.body); - - - return await handler(req, res) -} \ No newline at end of file +export default handler; \ No newline at end of file