2.0.9 • Published 8 years ago
inject-then v2.0.9
inject-then

Promise wrapper for Hapi's
server.inject
.
hapi@12
and above return a promise when no callback is passed to server.inject
. Use inject-then
for hapi versions less than 12
.
Setup
$ npm install inject-then
server.register(require('inject-then'), function (err) {
if (err) throw err
})
API
server.injectThen(options)
-> promise(response)
server.injectThen('/posts')
.then(function (response) {
assert.equal(response.statusCode, 200)
console.log('Success!')
})
Options
The following options
can be provided at registration:
Promise
: An optional Promise constructor (ES6 Promise or anything that can be called withnew Promise
). Bluebird is used if an override is not provided.
2.0.9
8 years ago
2.0.8
8 years ago
2.0.7
9 years ago
2.0.6
9 years ago
2.0.5
9 years ago
2.0.4
9 years ago
2.0.3
10 years ago
2.0.2
10 years ago
2.0.1
10 years ago
2.0.0
11 years ago
1.1.0
11 years ago
1.0.1
11 years ago
1.0.0
11 years ago
0.3.1
11 years ago
0.3.0
11 years ago
0.2.0
11 years ago
0.1.0
11 years ago
0.0.2
11 years ago