Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Build a Simple Dynamic Site with Node.js HTTP Methods and Headers Sending Content Type Headers in Node.js

How can I get the html we have generated to look like a web page?

Ok, so I have completed the course up this point and it's all looking good.

If I type

node app.js

into my terminal then hey presto - I get the generated html spew out on my screen.

Now my question is this; why is that html not being rendered as a web-page? When I right-click view page source, the html looks like valid code so it should display as such...

...What am I missing?

I would like to work locally if I can, so would prefer not to use workspaces.

*** EDIT -the video covers this but for some reason, when I watched the video, it skipped to the next in the series, hence the confusion!! ***

2 Answers

Michael Liendo
Michael Liendo
15,326 Points

Just to confirm, this is after you switched the content type from text/plain to text/html?

That would be it lol! Thanks!!

If you make that an answer Michael, I will mark it as a best answer!

Michael Liendo
Michael Liendo
15,326 Points

Thanks! Just made it an answer :)