Middleware for resilient.js HTTP client that integrates Consul as a service discovery server. Version 0.1.7 works with Consul HTTP API v1 and resilient.js >=0.3. Supports Node.js and browsers (via Bower or script tag). Provides fault-tolerant, load-balanced HTTP requests by querying Consul's catalog or health endpoint, allowing custom server mapping and per-service datacenter/tag filters. Differentiates by adding Consul discovery to resilient.js, enabling dynamic backend selection.
npm install resilient-consulVerified import paths — ran on the pinned version, not inferred.
Creates resilient HTTP client with Consul discovery using service 'web' from local Consul agent.
Migrate to another HTTP client with Consul support (e.g., axios + consul library).
Add 'Access-Control-Allow-Origin': '*' to Consul config http_api_response_headers.
Use 'http://consul-host:8500' not 'consul-host'.
Ensure mapServers handles health check response structure (array of objects with Service key).
Use `import consul from 'resilient-consul'` or `const consul = require('resilient-consul')`.Install resilient: `npm install resilient`.
Import Resilient: `import Resilient from 'resilient'` or `const Resilient = require('resilient')`.