diff --git a/docs/2.guide/2.directory-structure/1.server.md b/docs/2.guide/2.directory-structure/1.server.md index 68e418f4ff..90f5fbd3b6 100644 --- a/docs/2.guide/2.directory-structure/1.server.md +++ b/docs/2.guide/2.directory-structure/1.server.md @@ -111,10 +111,12 @@ For example, you can define a custom handler utility that wraps the original han **Example:** ```ts [server/utils/handler.ts] -import type { EventHandler } from 'h3' +import type { EventHandler, EventHandlerRequest } from 'h3' -export const defineWrappedResponseHandler = (handler: EventHandler) => - defineEventHandler(async (event) => { +export const defineWrappedResponseHandler = ( + handler: EventHandler +): EventHandler => + defineEventHandler(async event => { try { // do something before the route handler const response = await handler(event)