1.0.0 • Published 10 years ago

lc-sdk-node.js v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

lc-http-client

A HTTP client (Browsers and NodeJS) with Consul service discovery and endpoint fallbacks.

Build

npm run build

NodeJS specs

npm test

Browser

<script src="lc-http-client.js"></script>

NodeJS

var httpClient = require('lc-http-client');

API

var DISCOVERY_SERVICE_URLS = [
  'http://{your consul service}:8500',
  'http://{your consul service 2}:8500'
];

HTTPClient({ discoveryServers: DISCOVERY_SERVICE_URLS })
.get({yourServiceName}, {yourEndpointName})
.then(function(data){
  console.log(data);
})
.catch(function(error){
  console.error(error);
});
1.0.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago