Package Exports
- express-prettify
- express-prettify/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-prettify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
express-prettify
express middleware to send pretty printed json
Install
$ npm install express-prettifyExamples
"use strict";
var app = require('express')();
var pretty = require('express-prettify');
app.use(pretty({ query: 'pretty' }));
app.get('/', function(req, res) {
res.json({ hello: 'world', body: 'This is pretty printed json' });
});
app.listen(3000);$ node app.js &
$ curl http://localhost:3000?pretty
{
"hello": "world",
"body": "This is pretty printed json"
}
$ curl http://localhost:3000
{ "hello": "world", "body": "This is pretty printed json" }