2.0.2 • Published 6 years ago

trooba-xhr-transport v2.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

trooba-xhr-transport

codecov Build Status NPM Downloads Known Vulnerabilities

XHR transport for trooba pipeline to make CORS RESTful service calls from the browser.

Get Involved

  • Contributing: Pull requests are welcome!
  • Support: Join our gitter chat to ask questions to get support from the maintainers and other Trooba developers

Install

npm install trooba-xhr-transport --save

Usage

var xhrTransport = require('trooba-xhr-transport');
require('trooba')
    .use(xhrTransport, {
        protocol: 'http:',
        hostname: 'www.google.com'
        socketTimeout: 1000
    })
    .build()
    .create('client:default')
    .get({
        q: 'nike'
    })
    .set('some', 'header')
    .end(function (err, response) {
        console.log(err, response && response.body)
    });

For a real browser example, take a look at unit test. It uses lasso-js and marko-js to bundle resources into browser page including trooba xhr implementation.

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago