express-json

1.0.0 • Public • Published

express-json

A middleware for Express that sets Content-Type to text/plain if Accept header doesn't contain application/json.

Installation

$ npm install express-json

Usage

var express = require('express'),
    json = require('express-json');
 
var app = express()
  .use(json())
  .use(function (req, res) {
    res.json({
        helloWorld: 'Hello World!'
    });
  })
  .listen(3000);

Readme

Keywords

Package Sidebar

Install

npm i express-json

Weekly Downloads

479

Version

1.0.0

License

none

Last publish

Collaborators

  • jg8tf4