A simple node.js code to understand the basic of running a node server on your local machine. Note that the server will run on port 8080 i.e. https://localhost:8080
Steps to follow -
- Clone the repository using command - git clone https://github.com/kuhuk/BasicNodeServer.git
- Open the same repository in some IDE like VSCode (recommended)
- Run the following command in the terminal of IDE - node index.js
There you go! By now, your server should be running.
Now open your browser on your local machine and in a new tab copy paste the following link - https://localhost:8080
And you're done! ;)