Set up http server with the help of node.js to run html file locally

In the world of web automation, you may want to practice the automation. One may go for some sites in the internet and some may go for their own html applications which can be run locally. It is an easy way to learn both html and automation.

To run the html file, a server is required. The simplest server can be installed with the help of node.js. The following steps are Windows OS.


  • Make sure that node.js is installed (environment path variables etc are set)
  • Open the cmd and run the command $ npm install http-server -g
  • Once the server is installed, change to directory where the htmls files are stored
  • Run http-server

  • Open the browser
  • Type http://127.0.0.1:8081/ in address bar and press Enter
  • From the list of html files you can open the file you want.

This is one of the simple way to start a server and run your html files

About This Site

The main aim of this site is to share knowledge with fellow software test specialists who are keen to grow both technically and professionally.

Categories