Learn how to trigger a task from a webhook in a Next.js app.
pages/api/webhook-handler.ts
or pages/api/webhook-hander.js
.
In your new file, add the following code:
app/api/webhook-handler/route.ts
or app/api/webhook-handler/route.js
.
In your new file, add the following code:
Run your Next.js app and the Trigger.dev dev server
Trigger the webhook with some dummy data
http://localhost:3000
isn’t the URL of your locally running Next.js app, replace the URL in
the below command with that URL instead.Check the task ran successfully
{"name": "John Doe", "age": "87"}
.