Node.js – Tutorial – Rendering HTML as Response




Part of a complete node.js series, including the usage of Express.js and much more! Outputting plain text isn’t too exciting. Let’s learn how to respond with a …

Original source


32 responses to “Node.js – Tutorial – Rendering HTML as Response”

  1. Thank you for this, i was looking for how to connect my app.js to an html page and I did not know what is the word i should google for in this case, it was rendering XD.
    and can you do something about the audio it was to hard for me to understand

  2. Hi, thank you for the great video! I've got one question:
    After reading the html file in server.js, is there a way to edit the content of html before sending it to client as a response? Any recommended way of doing this?

    The whole picture is I'm trying to write a simple server using Nodejs. It will render a default html to client (browser). In the default html, there are some buttons and options. Clients can send requests using those buttons and options. After receiving requests, the server will modify the content of html file (will need to use data from server side) and send it back as a response.
    Am I doing it this correctly? Or there is other preferred ways?

  3. good explanation, if i change content in index.html , does it update dynamically, with out run js file on cmd all the times, when ever i change file. just like log file to shown all updates on the browser

  4. For anyone who is having issues where when you type in a different path, your page isn't changing, try looking at npm nodemon. That solved my issue. Restarts the server when a change is made.

  5. Well explained but can you please describe/or suggest how can I include external css, JS and images into with HTML using NodeJS?? All I'm geting through this was displaying html content only??

  6. WARNING: If you're a rookie using the new version of Node (8.0), you'll probably run into weird errors during this tutorial. At least I did. I had to downgrade to an older version of Node and then everything went smoothly. Great tutorial series, btw.

Leave a Reply