This package has been deprecated

Author message:

Package is no longer maintained

redirect-requests

1.0.0 • Public • Published

redirect-requests Circle CI

Redirect requests transparently to other server. Useful for testing code, that sends requests to remote servers.

Installation

$ npm install redirect-requests --save

Usage

Example usage with got request library:

const redirect = require('redirect-requests');
const got = require('got');
 
redirect('ghost.org', 'localhost:8080');
 
// enable interceptor
redirect.enable();
 
got('http://ghost.org/some/path', function (err, body) {
  // request will not be sent to ghost.org
  // but to localhost:8080
 
  // after you are done, disable redirect
  redirect.disable();
});

Tests

Circle CI

$ make test

License

MIT @ Vadim Demedes.

/redirect-requests/

    Package Sidebar

    Install

    npm i redirect-requests

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • vdemedes