Total Pageviews

Sunday 14 October 2018

NodeJS - Setup a HTTP / Local Web Server

Sometimes we need to test our web application on different devices before deploying it on actual production server, as we need to be sure that application is working properly and we can get time to fix any UI related issues.

To resolve this issue we can setup a localhost server using NodeJs. I have listed down few steps to setup a simple HTTP server or local web server.

  1. Download and install NodeJS from https://nodejs.org.
  2. Run npm install -g http-server 
  3. Go to the path where application folder exists with index.html from command prompt.
  4. Run http-server command from command prompt.
  5. Open browser and run http://localhost:8080 and you should see your local website as mine.


Happy Coding :)

No comments:

Post a Comment

Microsoft Logo using flexbox and Reactjs

 <!DOCTYPE html> <html> <head>     <script src="https://unpkg.com/react@18/umd/react.development.js" crossori...