Clean up custom hooks docs

This commit is contained in:
Ben Haynes
2020-09-25 14:17:20 -04:00
parent 12222d8545
commit b6fcfd4054

View File

@@ -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: