1.0.0 • Published 10 years ago

connect-send-json v1.0.0

Weekly downloads
39
License
Apache2
Repository
github
Last release
10 years ago

connect-send-json

Adds the response.json() middleware to connect and connect-like http stacks.

Usage

'use strict';

var connect = require('connect')
  , app = connect()
  , send = require('connect-send-json')
  ;

app
  .use(send.json())
  .use(function (req, res) {
    res.statusCode = 501;
    res.json({
      error: { message: "Not Implemented" }
    });
  })
  ;

module.exports = app;