@ladjs/web 21.0.28 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -95,6 +95,9 @@ class Web {
95
95
  sessionKeys: process.env.SESSION_KEYS
96
96
  ? process.env.SESSION_KEYS.split(',')
97
97
  : ['lad'],
98
+ prettyPrintedJSON: process.env.PRETTY_PRINTED_JSON
99
+ ? Boolean(process.env.PRETTY_PRINTED_JSON)
100
+ : false,
98
101
  cookiesKey: process.env.COOKIES_KEY || 'lad.sid',
99
102
  favicon: {
100
103
  path: path.resolve('./assets/img/favicon.ico'),
@@ -376,7 +379,8 @@ class Web {
376
379
  app.use(bodyParser());
377
380
 
378
381
  // pretty-printed json responses
379
- app.use(json());
382
+ // (default unless in development/test environment)
383
+ app.use(json({ pretty: this.config.prettyPrintedJSON, param: 'pretty' }));
380
384
 
381
385
  // method override
382
386
  // (e.g. `<input type="hidden" name="_method" value="PUT" />`)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ladjs/web",
3
3
  "description": "Web server for Lad",
4
- "version": "21.0.28",
4
+ "version": "21.1.0",
5
5
  "author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/ladjs/web/issues",