algolia / faux-jax

NO MORE MAINTAINED: Intercept and respond to requests in the browser (AJAX) and Node.js (http(s) module)
MIT License
95 stars 10 forks source link

faux-jax now supports node.js http #7

Closed vvo closed 9 years ago

vvo commented 9 years ago

Using moll/node-mitm I was able to make faux-jax intercept Node.js http/https module using the same interface.

It means faux-jax now works both on the browser and the server.

The big change is that intercepting requests is now asynchronous:

var fauxJax = require('faux-jax');

fauxJax.on('request', function(request) {
  // request.respond..
});