You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/frameworks/nextjs-webhooks.mdx
+30-6Lines changed: 30 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,41 @@ description: "Learn how to trigger a task from a webhook in a Next.js app."
11
11
12
12
## Adding the webhook handler
13
13
14
-
The webhook handler in this guide will be an API route. The location of the route file will be different depending on whether you are using the Next.js pages router or the app router.
14
+
The webhook handler in this guide will be an API route.
15
15
16
-
-**Pages router** - create a new file `pages/api/webhook-handler.ts` or `pages/api/webhook-hander.js`.
16
+
This will be different depending on whether you are using the Next.js pages router or the app router.
17
17
18
-
-**App router** - create a new file in the `app/api/webhook-handler/route.ts` or `app/api/webhook-handler/route.js`.
18
+
### Pages router: creating the webhookhandler
19
19
20
-
The handler code will be the same for both routers. In this guide will use the 'Hello World' task as the example.
20
+
Create a new file `pages/api/webhook-handler.ts` or `pages/api/webhook-hander.js`.
0 commit comments