npm install benderjs-proxyHTTP proxy for Bender.js using node-http-proxy. Especially useful for testing Cross-Origin requests.
```
npm install benderjs-proxy
Add benderjs-proxy to the plugins array in your bender.js configuration file:
`javascript
var config = {
plugins: [ 'benderjs-proxy' ] // load the plugin
};
module.exports = config;
`
You can configure proxy in bender.js configuration file.`javascript
var config = {
(...)
proxy: {
// Below configuration will redirect all requests from http://
'/google': 'http://google.com',
// You can also pass a function as a proxy target, it will receive a URL object produced using Node's url.parse() method
'/foobar': function( url ) {
return 'http://example.com/foo/bar' + ( url.search || '' );
}
}
};
module.exports = config;
``
MIT, for license details see: LICENSE.md.