Categories
HTML

How to run HTML file on localhost?

Spread the love

Sometimes, we want to run HTML file on localhost.

In this article, we’ll look at how to run HTML file on localhost.

How to run HTML file on localhost?

To run HTML file on localhost, we can use the http-server Node module.

First, we install Node.js in our system.

Then In CMD, run the command npm install http-server -g.

Next, we navigate to the path of your file folder in CMD and run the http-server command

Finally, we go to our browser and type localhost:8080.

Now we should see the page we want to load.

Conclusion

To run HTML file on localhost, we can use the http-server Node module.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.