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

    Function onResponse

    • Fastify onResponse hook that logs completed request details:

      {ip} -- {method} {url} HTTP/{httpVersion} {status} {size} {elapsed}ms "{referrer}" "{userAgent}"
      

      Intended to be registered via:

      fastify.addHook("onResponse", onResponse)
      

      Uses reply.log.info for 2xx/3xx and reply.log.error for 4xx/5xx, so each log record is automatically correlated with the request ID assigned by Fastify.

      Parameters

      • request: FastifyRequest
      • reply: FastifyReply

      Returns Promise<void>