Last Updated: February 25, 2016
· third

Pretty HTML source code in Express

Sometimes you wanted to see a snapshot of the generated HTML code of your app prior to any DOM manipulation (i.e. view source). I have been using app.locals.pretty = true; for a while but I did not know this when I first used node and express so I wanted to share for new comers. It is recommended to only call this on development due to performance reason.

app.configure('development', function(){  
  app.locals.pretty = true;

1 Response
Add your response

Good to know, thanks for sharing!

over 1 year ago ·