@@ -4,7 +4,7 @@ import { FastifySchemaCompiler, FastifySchemaValidationError } from './schema'
4
4
import { RawServerBase , RawRequestDefaultExpression , RawServerDefault , RawReplyDefaultExpression , ContextConfigDefault } from './utils'
5
5
import { FastifyLoggerInstance } from './logger'
6
6
import { FastifyRegister } from './register'
7
- import { onRequestHookHandler , preParsingHookHandler , onSendHookHandler , preValidationHookHandler , preHandlerHookHandler , preSerializationHookHandler , onResponseHookHandler , onErrorHookHandler , onRouteHookHandler , onRegisterHookHandler , onCloseHookHandler , onReadyHookHandler , onTimeoutHookHandler , onRequestAsyncHookHandler , preParsingAsyncHookHandler , preValidationAsyncHookHandler , preHandlerAsyncHookHandler , preSerializationAsyncHookHandler , onSendAsyncHookHandler , onResponseAsyncHookHandler , onTimeoutAsyncHookHandler , onErrorAsyncHookHandler , onReadyAsyncHookHandler } from './hooks'
7
+ import { onRequestHookHandler , preParsingHookHandler , onSendHookHandler , preValidationHookHandler , preHandlerHookHandler , preSerializationHookHandler , onResponseHookHandler , onErrorHookHandler , onRouteHookHandler , onRegisterHookHandler , onCloseHookHandler , onReadyHookHandler , onTimeoutHookHandler , preParsingAsyncHookHandler , preValidationAsyncHookHandler , preHandlerAsyncHookHandler , preSerializationAsyncHookHandler , onSendAsyncHookHandler , onResponseAsyncHookHandler , onTimeoutAsyncHookHandler , onErrorAsyncHookHandler , onReadyAsyncHookHandler } from './hooks'
8
8
import { FastifyRequest } from './request'
9
9
import { FastifyReply } from './reply'
10
10
import { FastifyError } from 'fastify-error'
@@ -96,14 +96,6 @@ export interface FastifyInstance<
96
96
hook : onRequestHookHandler < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig >
97
97
) : FastifyInstance < RawServer , RawRequest , RawReply , Logger > ;
98
98
99
- addHook <
100
- RouteGeneric extends RouteGenericInterface = RouteGenericInterface ,
101
- ContextConfig = ContextConfigDefault
102
- > (
103
- name : 'onRequest' ,
104
- hook : onRequestAsyncHookHandler < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig >
105
- ) : FastifyInstance < RawServer , RawRequest , RawReply , Logger > ;
106
-
107
99
/**
108
100
* `preParsing` is the second hook to be executed in the request lifecycle. The previous hook was `onRequest`, the next hook will be `preValidation`.
109
101
* Notice: in the `preParsing` hook, request.body will always be null, because the body parsing happens before the `preHandler` hook.
0 commit comments