Skip to content

Commit

Permalink
fix: rm changes in path.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
CahidArda committed Nov 11, 2024
1 parent d352690 commit 21bc6d0
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions examples/nextjs-pages/src/pages/api/path.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
}
export default handler;

0 comments on commit 21bc6d0

Please sign in to comment.