2.0.2 • Published 11 years ago
qb-http v2.0.2
qb-http
HTTP-based push and receive components for qb. This allows you to use HTTP to communicate between service applications.
Usage
The http dialect is simple.
npm install qb-http --save // Receive component
qb.component(require('qb-http').receive, httpReceiveOptions)
.on('http-ready', function () {
console.log('http server is setup and ready to go')
})
// Push component
.component(require('qb-http').push, httpPushOptions)
.alias('foobar', 'http://my.other.service.com/api/v1/push/foobar')
.push('foobar', {baz: buzz})Also, here's the external API (if the base option is /api/qb:
$ curl http://server.domain.tld/api/qb/service-name -XPOST -H'Content-Type: application/json' -d'{"task": "data"}'Options
Push Options
retryNumber of times to retry a http curl if an error is encountered.
Receive Options
portPort Number (if not present, server will not be started to listen)unixA path to a unix socket (only listened on ifportis falsy)appPass in an express app. If none is passed, one will be created.baseBase api prefixno_middlewareDont attach middleware (body parser is the only required one. logging is suggested)authA{user: '', pass: ''}object for basic authno_404_catchDon't attach a catch-all atbaseto reply with a 404 Not FoundreplyAfunction (req, res, error)to respond to requests. Default usesjsonp
To access the underlying express server, use qb._http.app and qb._http.server.
License
MIT in LICENSE file
2.0.2
11 years ago
2.0.1
11 years ago
2.0.0
11 years ago
2.0.0-rc1
11 years ago
0.2.4
12 years ago
0.2.3
12 years ago
0.2.2
12 years ago
0.2.1
12 years ago
0.2.0
12 years ago
0.1.12
12 years ago
0.1.11
12 years ago
0.1.10
12 years ago
0.1.9
12 years ago
0.1.8
12 years ago
0.1.7
12 years ago
0.1.6
12 years ago
0.1.5
12 years ago
0.1.4
12 years ago
0.1.3
12 years ago
0.1.2
12 years ago
0.1.1
12 years ago
0.1.0
12 years ago
0.0.3
12 years ago
0.0.2
12 years ago
0.0.1
12 years ago