node package manager


API testing proxy

Rec-uest helps you better debug API's by allowing you to record, and twiddle http requests on the fly.

  • Faster debugging since testing is done locally
  • Automated testing made easier
  • Easier to debug any outlying issues with API responses
  • Simulate server states
    • server outages
npm install recuest -g
Usage: --env=[env] [config paths]
  --env  [default: "default"]

Here's an example where the proxy might simulate a 500 internal server error:

recuest --env=default,500 /path/to/config.json

And here's /path/to/config.json:

    "default": {
        "port": 8080,
        "profile": "default",
        "db": {
            "driver": "Mongo",
            "port": 27017,
            "host": "",
            "database": "recuest"
    "500": {
     "profile": "500",
     "twiddle": {
     "response": [
     "fiddle": {
     "$set": {
     "statusCode": 500,
     "body": "A 500 internal server error has occurred."

In your node.js app, make sure to use this chunk of code:

//monkey-patches the http module so all requests redirect through the proxy 
    host: "http://localhost:8080"
var request = require("request");
//redirects through the proxy 
request.get("", function(err, response, body) {

Finally, call node ./my/app.js, and you should see A 500 internal server error has occurred.