Skip to content

Commit

Permalink
Update migration-guide-beta.20-to-3.0.0.md (#6750)
Browse files Browse the repository at this point in the history
I did everything but noticed that the documentation isn't clear about hooks. I literally moved contents of the hook.json file to a new file hook.js without the settings key and nothing worked until I moved into settings key as specified in the hooks section.
  • Loading branch information
emahuni committed Jul 16, 2020
1 parent b2d4fbf commit 9a6de2a
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/v3.x/migration-guide/migration-guide-beta.20-to-3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,33 @@ If you never configured any middlewares you can delete the file all together. Yo

We applied the same logic from the `middleware` configuration to the `hook` configuration.

First you can create a file `./config/hook.js`, and you can move the content of `./config/hook.json` into it.
First you can create a file `./config/hook.js`, and you can move the content of `./config/hook.json` into it. Hooks should be placed under settings key eg:
```js
module.exports = {
timeout: 10000,
load: {
before: ['hook-1', 'hook-2'],
order: [
"Define the hooks' load order by putting their names in this array in the right order",
],
after: ['hook-3', 'hook4'],
},
settings: {
'hook-1': {
enabled: true
},
'hook-2': {
enabled: true
},
'hook-3': {
enabled: true
},
'hook4': {
enabled: true
},
},
};
```

::: tip
If you never configured any hook you can delete the file all together. You can also only set the configurations you want to customize and leave the others out.
Expand Down

0 comments on commit 9a6de2a

Please sign in to comment.