Vendure exposes a /health endpoint that reports the status of critical system dependencies.
This endpoint is essential for production deployments where load balancers, container orchestrators,
and monitoring tools need to know whether the application is healthy and ready to serve traffic.
Each configured health check strategy probes a specific dependency and reports back with a status.
The /health endpoint aggregates all strategy results into a single response.
A healthy response indicates that all dependencies are reachable and functioning correctly. If any strategy reports a failure, the endpoint returns an unhealthy status, signaling that the system may not be able to serve requests reliably.
Vendure ships with two health check strategies out of the box:
TypeORMHealthCheckStrategy — verifies that the database connection is alive by executing
a simple query. Since the database is the most critical dependency for any Vendure instance,
this strategy is enabled by default.
HttpHealthCheckStrategy — checks the availability of an external HTTP service. This is
useful when your Vendure instance depends on external APIs, such as a payment gateway or a
third-party inventory system.
Health checks are configured via the systemOptions.healthChecks property in the
VendureConfig. You can enable or disable
individual strategies and configure their parameters to match your infrastructure.
The /health endpoint serves several important operational purposes:
/health and route traffic
only to healthy instances.When your application has dependencies beyond the database and HTTP services, you can implement
the HealthCheckStrategy interface to create custom checks. For example, a custom strategy might
verify connectivity to a Redis cache, an Elasticsearch cluster, or a message broker.
Custom strategies are added to the same systemOptions.healthChecks configuration array alongside
the built-in strategies, and their results are included in the aggregated /health response.