flashheart
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -11,3 +11,4 @@ var _ = require('lodash'); | ||
gzip: true, | ||
time: true | ||
time: true, | ||
forever: true | ||
}); | ||
@@ -14,0 +15,0 @@ |
{ | ||
"name": "flashheart", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A fully-featured REST client built for ease-of-use and resilience", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,2 +65,4 @@ # flashheart | ||
```js | ||
var Catbox = require('catbox').Client; | ||
var Memory = require('catbox-memory'); | ||
var storage = new Catbox(new Memory()); | ||
@@ -75,3 +77,3 @@ var client = require('flashheart').createClient({ | ||
```js | ||
var client = require('@ibl/flashheart').createClient({ | ||
var client = require('flashheart').createClient({ | ||
cache: storage, | ||
@@ -154,3 +156,3 @@ doNotVary: ['Request-Id'] | ||
```js | ||
var customRequest = require('request').defaults({ | ||
var request = require('request').defaults({ | ||
json: false, | ||
@@ -163,6 +165,23 @@ headers: { | ||
var client = require('flashheart').createClient({ | ||
request: customRequest | ||
request: request | ||
}); | ||
``` | ||
#### Usage with client certificates | ||
The `request` option can also be used to pass a pre-configured request client for HTTPS client certificate authentication: | ||
```js | ||
var fs = require('fs'); | ||
var request = require('request').defaults({ | ||
pfx: fs.readFileSync('/path/to/my/cert.p12'), | ||
passphrase: 'password', | ||
strictSSL: false | ||
}); | ||
var client = require('flashheart').createClient({ | ||
request: request | ||
}); | ||
``` | ||
## API | ||
@@ -169,0 +188,0 @@ |
@@ -205,3 +205,3 @@ var nock = require('nock'); | ||
server.listen(0); | ||
var url = util.format('http://%s:%d', server.address().address, server.address().port); | ||
var url = util.format('http://127.0.0.1:%d', server.address().port); | ||
nock.enableNetConnect(url.replace('http://', '')); | ||
@@ -208,0 +208,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45729
1101
252