@darthcav/ts-http-server
    Preparing search index...

    Function preHandler

    • Fastify preHandler hook that logs incoming request details:

      Incoming request [{id}]: {method} {url} HTTP/{httpVersion} from {ip}
      

      Intended to be registered via:

      fastify.addHook("preHandler", preHandler)
      

      Uses request.log.debug so each log record is automatically correlated with the request ID assigned by Fastify.

      Requests whose URL is in NO_CONTENT_PATHS (e.g. the Chromium DevTools discovery probe) are short-circuited with an empty 204 No Content response, preventing them from reaching the notFound handler and being logged as 404 errors.

      Parameters

      • request: FastifyRequest

        The incoming Fastify request to log.

      • reply: FastifyReply

        The Fastify reply, used to short-circuit known probe paths.

      Returns Promise<void>