Skip to content

Commit c7c5336

Browse files
docs: fix docorators example (fastify#5997)
* Update Decorators.md Signed-off-by: Logan Luo <[email protected]> * Update docs/Reference/Decorators.md Co-authored-by: KaKa <[email protected]> Signed-off-by: Logan Luo <[email protected]> --------- Signed-off-by: Logan Luo <[email protected]> Co-authored-by: KaKa <[email protected]>
1 parent e9485f1 commit c7c5336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/Reference/Decorators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ incoming request in the [`'onRequest'` hook](./Hooks.md#onrequest).
187187
const fp = require('fastify-plugin')
188188

189189
async function myPlugin (app) {
190-
app.decorateRequest('foo')
190+
app.decorateReply('foo')
191191
app.addHook('onRequest', async (req, reply) => {
192-
req.foo = { bar: 42 }
192+
reply.foo = { bar: 42 }
193193
})
194194
}
195195

0 commit comments

Comments
 (0)