Installing a Node Web Server using http-server

Leave a comment
BEFORE WE START, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

Node has several web servers available for installation, including http-server:

To install, type:

npm install http-server -g

To start the server, type:

http-server

This will start the web server at the addresses:

Opening a web page at this address will display the contents of the current directory:

If we create a folder called webserver with one file, index.html, and browse to this directory, we see the index file is displayed:

We can specify the web server directory and port with the command:

http-server C:/webserver -p 7777

This produces:

And if we browse now we see the index page directly:

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

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