Skip to content

Commit d737de7

Browse files
committed
fix: Improved README.
1 parent 4641ed0 commit d737de7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ import { NotFoundError } from 'http-errors-enhanced'
5252

5353
const server = fastify()
5454

55-
// Note that await is mandatory here otherwise response validation will be lost
55+
/*
56+
Since fastify-http-errors-enhanced uses an onRoute hook, you have to either:
57+
58+
* use `await register...`
59+
* wrap you routes definitions in a plugin
60+
61+
See: https://www.fastify.io/docs/latest/Guides/Migration-Guide-V4/#synchronous-route-definitions
62+
*/
5663
await server.register(fastifyHttpErrorsEnhanced)
5764

5865
server.get('/invalid', {

0 commit comments

Comments
 (0)