Stone.js API
    Preparing search index...
    • Run every registered check and say, once, whether the application is serving.

      A health endpoint is a binary question asked by something that cannot read: a load balancer deciding whether to send traffic, a platform deciding whether to replace the instance. So the answer is a status code first, and a body for the human who follows up.

      Two properties make it usable as a probe. It never hangs: a check that does not answer within its timeout is a failed check, because a probe that waits is worse than one that fails. And it never throws: a check that raises reports its own failure and the others still report theirs, since the point of a report is to name which dependency is down, not to stop at the first.

      With nothing registered it answers healthy, which is the honest answer to "is the process up and routing": it is, and nothing has claimed otherwise.

      Parameters

      • checks: MetaHealthCheck[]

        The registered checks.

      • Optionalresolve: (target: any) => unknown

        How to build a class or factory check, normally the container.

      • timeout: number = DEFAULT_HEALTH_TIMEOUT

        How long each check may take.

      Returns Promise<HealthReport>

      The report.