- remove_red_eye2609 Views
- event28 Aug 2016
- access_time2 min read
Generally, during the front-end development, we require the Web server to run our code and we eventually end up using Apache or Nginx etc. If you use Nodejs or Nodejs environment (Using gulp, grunt or mocha which runs on Node) then there is quick zero configuration package for you that works as HTTP server without writing a single line of code or going through setup.
Assuming you have Node.js installed in your system. Install the module called ‘http-server’ using the following command.
That’s it. Now you can deliver any static files using this module.
Switch to any folder containing the HTML or static files. Run the Server using the following command.
It will by default load index.html in browser, if present. Point your browser to localhost:8080
You can change the options such as port etc by providing the parameter.
For more information on parameters, click here.