Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettify JSON responses #40

Closed
leo opened this issue Sep 28, 2017 · 3 comments · Fixed by #58
Closed

Prettify JSON responses #40

leo opened this issue Sep 28, 2017 · 3 comments · Fixed by #58

Comments

@leo
Copy link
Contributor

leo commented Sep 28, 2017

By default, we should run them trough JSON.stringify(obj, 0, 2)!

@TooTallNate
Copy link
Member

TooTallNate commented Sep 28, 2017

Doesn't this already happen when process.env.NODE_ENV == 'development'?

@leo
Copy link
Contributor Author

leo commented Sep 29, 2017

@TooTallNate That's micro - but awesome observation. We need to remove it from there (so that micro is only for prod) and add it to micro-dev by default.

@kandros
Copy link
Contributor

kandros commented Dec 16, 2017

while #58 is a workaround

I tried to patch res.end but it looses the last line for some reasons, can try at https://github.com/kandros/micro-dev/blob/pretty-print-response/lib/pretty-json.js

@leo leo closed this as completed in #58 Dec 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants