express-apiproxy

A module to make a bridge between user's request and backend HTTP API server.

Usage no npm install needed!

<script type="module">
  import expressApiproxy from 'https://cdn.skypack.dev/express-apiproxy';
</script>

README

express-apiproxy

Build Status

A module to make a bridge between user's request and backend HTTP API server. It works with express.

Usage

    var apiproxy = require('apiproxy');

    // ... whip up an express app

    app.get('/', function (req, res) {
        // apiproxy will proxy cookie in `req` to target api address
        var request = apiproxy.proxy(req);

        request('http://a/b/c.json', function (error, response, body) {
            // mikeal/request style response callback
        });
    });

The apiproxy proxy will return a request object, it means you can use streaming or options like request, it's very simple.

License

MIT