Home / Class/ fastify Class — fastify Architecture

fastify Class — fastify Architecture

Architecture documentation for the fastify class in fastify.d.ts from the fastify codebase.

Entity Profile

Dependency Diagram

graph TD
  31b8a69d_b6ff_a840_ff4e_96d99f138cd0["fastify"]
  cb91d14d_6002_0517_9501_c656cef3fccb["fastify.d.ts"]
  31b8a69d_b6ff_a840_ff4e_96d99f138cd0 -->|defined in| cb91d14d_6002_0517_9501_c656cef3fccb
  c7aeb739_f271_f0aa_6074_daef8567a2cf["add()"]
  31b8a69d_b6ff_a840_ff4e_96d99f138cd0 -->|method| c7aeb739_f271_f0aa_6074_daef8567a2cf
  f66a3f3c_8191_e63c_3c24_0442d9321007["getSchema()"]
  31b8a69d_b6ff_a840_ff4e_96d99f138cd0 -->|method| f66a3f3c_8191_e63c_3c24_0442d9321007
  675254f1_a43e_e790_782e_6c5dab0aaa8c["getSchemas()"]
  31b8a69d_b6ff_a840_ff4e_96d99f138cd0 -->|method| 675254f1_a43e_e790_782e_6c5dab0aaa8c
  8602b2b8_1df8_0887_43ac_09c28c3a02da["fastify()"]
  31b8a69d_b6ff_a840_ff4e_96d99f138cd0 -->|method| 8602b2b8_1df8_0887_43ac_09c28c3a02da

Relationship Graph

Source Code

fastify.d.ts lines 45–208

declare namespace fastify {
  export const errorCodes: FastifyErrorCodes

  export type FastifyHttp2SecureOptions<
    Server extends http2.Http2SecureServer,
    Logger extends FastifyBaseLogger = FastifyBaseLogger
  > = FastifyServerOptions<Server, Logger> & {
    http2: true,
    https: http2.SecureServerOptions,
    http2SessionTimeout?: number
  }

  export type FastifyHttp2Options<
    Server extends http2.Http2Server,
    Logger extends FastifyBaseLogger = FastifyBaseLogger
  > = FastifyServerOptions<Server, Logger> & {
    http2: true,
    http2SessionTimeout?: number
  }

  export type FastifyHttpsOptions<
    Server extends https.Server,
    Logger extends FastifyBaseLogger = FastifyBaseLogger
  > = FastifyServerOptions<Server, Logger> & {
    https: https.ServerOptions | null
  }

  export type FastifyHttpOptions<
    Server extends http.Server,
    Logger extends FastifyBaseLogger = FastifyBaseLogger
  > = FastifyServerOptions<Server, Logger> & {
    http?: http.ServerOptions | null
  }

  type FindMyWayVersion<RawServer extends RawServerBase> = RawServer extends http.Server ? HTTPVersion.V1 : HTTPVersion.V2
  type FindMyWayConfigForServer<RawServer extends RawServerBase> = FindMyWayConfig<FindMyWayVersion<RawServer>>

  export interface ConnectionError extends Error {
    code: string,
    bytesParsed: number,
    rawPacket: {
      type: string,
      data: number[]
    }
  }

  type TrustProxyFunction = (address: string, hop: number) => boolean

  export type FastifyRouterOptions<RawServer extends RawServerBase> = Omit<FindMyWayConfigForServer<RawServer>, 'defaultRoute' | 'onBadUrl' | 'querystringParser'> & {
    defaultRoute?: (
      req: RawRequestDefaultExpression<RawServer>,
      res: RawReplyDefaultExpression<RawServer>
    ) => void,
    onBadUrl?: (
      path: string,
      req: RawRequestDefaultExpression<RawServer>,
      res: RawReplyDefaultExpression<RawServer>
    ) => void,
    querystringParser?: (str: string) => { [key: string]: unknown }
  }

  /**
   * Options for a fastify server instance. Utilizes conditional logic on the generic server parameter to enforce certain https and http2
   */
  export type FastifyServerOptions<
    RawServer extends RawServerBase = RawServerDefault,
    Logger extends FastifyBaseLogger = FastifyBaseLogger
  > = {
    ignoreTrailingSlash?: boolean,
    ignoreDuplicateSlashes?: boolean,
    connectionTimeout?: number,
    keepAliveTimeout?: number,
    maxRequestsPerSocket?: number,
    forceCloseConnections?: boolean | 'idle',
    requestTimeout?: number,
    pluginTimeout?: number,
    bodyLimit?: number,
    maxParamLength?: number,
    disableRequestLogging?: boolean | ((req: FastifyRequest) => boolean),
    exposeHeadRoutes?: boolean,
    onProtoPoisoning?: ProtoAction,

Domain

Defined In

Frequently Asked Questions

What is the fastify class?
fastify is a class in the fastify codebase, defined in fastify.d.ts.
Where is fastify defined?
fastify is defined in fastify.d.ts at line 45.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free