mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Clean up custom hooks docs
This commit is contained in:
@@ -81,6 +81,8 @@ module.exports = function registerHook() {
|
||||
}
|
||||
```
|
||||
|
||||
## 4. Develop your Custom Hook
|
||||
|
||||
### Register Function
|
||||
|
||||
The register function (eg: `module.exports = function registerHook()`) must return an object where the key is the event, and the value is the handler function itself.
|
||||
@@ -103,6 +105,14 @@ The event handler function (eg: `'item.create.articles': function()`) recieves a
|
||||
* `action` — Action that is performed [Learn More](#)
|
||||
* `payload` — Payload of the request [Learn More](#)
|
||||
|
||||
## 5. Restart the API
|
||||
|
||||
To deploy your hook, simply restart the API by running:
|
||||
|
||||
```bash
|
||||
npx directus start
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Full example:
|
||||
|
||||
Reference in New Issue
Block a user