How to run HTML file on localhost?

Spread the love

To run HTML file on localhost, we use the http-server npm package.

To use it, we

  1. install Node.js

  2. In CMD, run npm install http-server -g to install http-server globally.

  3. Navigate to the specific path of your file folder in CMD and run http-server

  4. Go to your browser and type localhost:8080.

Leave a Reply

Your email address will not be published. Required fields are marked *