Make a project directory and create the following files inside that directory:
index.html
about.html
contact-me.html
404.html
Create your node.js server file index.js and add the code needed to serve the right page according to the url.
localhost:8080 should take users to index.html
localhost:8080/about should take users to about.html
localhost:8080/contact-me should take users to contact-me.html
404.html should display any time the user tries to go to a page not listed above.
Extracted from: The odin's project first node project
Made with help from the following link: How to create a web Server in node with http module
Thanks to Codeium really good suggestions of code.