How can I get Express to output nicely formatted HTML?

前端 未结 9 641
名媛妹妹
名媛妹妹 2020-11-28 01:13

When using Express for Node.js, I noticed that it outputs the HTML code without any newline characters or tabs. Though it may be more efficient to download, it\'s not very r

9条回答
  •  眼角桃花
    2020-11-28 01:45

    building off of oliver's suggestion, heres a quick and dirty way to view beautified html

    1) download tidy

    2) add this to your .bashrc

    function tidyme() {
    curl $1 | tidy -indent -quiet -output tidy.html ; open -a 'google chrome' tidy.html
    }
    

    3) run

    $ tidyme localhost:3000/path
    

    the open command only works on macs. hope that helps!

提交回复
热议问题