curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
525 stars 7 forks source link

[Feature] Pretty-print JSON output #168

Closed spidgorny closed 3 years ago

spidgorny commented 3 years ago

How can I make the JSON output to be pretty-printed (line breaks and indents)?

Function sendBody() in http-utils.ts does JSON.stringify(body). Any way to make it configurable?

I think I can set the res.body in ALL my controllers to pre-formatted JSON string, but this can be too much changes for a trivial problem.

Is there a output middleware? I've only seen middleware that processes input in some way.

spidgorny commented 3 years ago

Duplicate of #169 . Please close.