MCPcopy
hub / github.com/fastify/fastify / addHook

Method addHook

types/instance.d.ts:227–227  ·  types/instance.d.ts::FastifyInstance.addHook

* `onRequest` is the first hook to be executed in the request lifecycle. There was no previous hook, the next hook will be `preParsing`. * Notice: in the `onRequest` hook, request.body will always be null, because the body parsing happens before the `preHandler` hook.

(
    name: 'onRequest',
    hook: Fn extends unknown ? Fn extends AsyncFunction ? onRequestAsyncHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger> : onRequestHookHandler<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, Logger> : Fn,
  )

Source from the content-addressed store, hash-verified

225 * Notice: in the `onRequest` hook, request.body will always be null, because the body parsing happens before the `preHandler` hook.
226 */
227 addHook<
228 RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
229 ContextConfig = ContextConfigDefault,
230 SchemaCompiler extends FastifySchema = FastifySchema,

Callers 15

pluginFunction · 0.80
plugin.3.test.jsFile · 0.80
reply-code.test.jsFile · 0.80
route.6.test.jsFile · 0.80
route.8.test.jsFile · 0.80
issue-4959.test.jsFile · 0.80
testExecutionHookFunction · 0.80
decorator.test.jsFile · 0.80

Calls

no outgoing calls

Tested by 4

pluginFunction · 0.64
testExecutionHookFunction · 0.64
pluginFunction · 0.64