-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: macdonst <[email protected]>
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Webhooks | ||
--- | ||
|
||
A webhook is a method of augmenting or altering the behavior of a web page or web application with custom callbacks. | ||
|
||
You can use a api route to receive webhooks from third parties: | ||
|
||
<doc-code filename="app/api/webhook.mjs"> | ||
|
||
```javascript | ||
export async function post (req) { | ||
try { | ||
const data = req.body | ||
// Process the webhook payload | ||
// Validate payload, etc. | ||
} catch (error) { | ||
return { | ||
status: 400, | ||
} | ||
} | ||
|
||
return { | ||
status: 200, | ||
} | ||
} | ||
``` | ||
|
||
</doc-code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters