{"library":"resilient-consul","title":"resilient-consul","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install resilient-consul"],"cli":null},"imports":["import consul from 'resilient-consul'","import { consul } from 'resilient-consul'","import Resilient from 'resilient'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Resilient from 'resilient';\nimport consul from 'resilient-consul';\n\nconst client = Resilient();\n\nclient.use(consul({\n  service: 'web',\n  servers: ['http://localhost:8500'],\n  datacenter: 'dc1',\n  tag: '1.0',\n  onlyHealthy: true,\n  mapServers: (list) => list.map(svc => svc.ServiceAddress + '/v1')\n}));\n\nclient.get('/api/health', (err, res) => {\n  if (err) console.error('Error:', err);\n  else console.log('Response:', res);\n});","lang":"typescript","description":"Creates resilient HTTP client with Consul discovery using service 'web' from local Consul agent.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}