Turn your laptop into a Web Server to serve static files in minutes with Node Js and Http-server

preview_player
Показать описание


In this video, we will learn how to install nodejs and turn your laptop or computer into a mini web server serving static HTML/Javascript/css this is a great tool and quick way for development especially for writing javascript. Instead of double-clicking your HTML file to open, you will host web server instead so you can access it from other machines too.

npm install http-server -g

cd folder_with_html_files

http-server .

HTTP-Server node, setup http-server node, static html file web server, setup webserver quick, nodejs webserver

Stay Awesome!
Hussein
Рекомендации по теме
Комментарии
Автор

There is a bug in recent versions of http-server that will give invalid redirect error when not specifying the index.html pate To work around it uninstall the http-server version you have

npm uninstall -g http-server

Then install version 0.9




hnasr
Автор

Thank you for sharing your knowledge! Your channel always helps me!!!

alejandropagtalunan
Автор

Nice, simple and straight to the point, thank you.

spampan
Автор

Thanks! That was soo easy and straightforward thanks to your guidance :))

Автор

finding your channel is the best thing that happened today :)

romanleca
Автор

Thx a lot, very good and easy (!) to follow! My skillz doubled... from 1 to 2 :-D

falkschiffner
Автор

Please can you help me, i have a similar app and want to deploy it on heroku

eklavyachandra
Автор

Hello, can you help me? I created the server and it works fine with the HTML, the CSS file is in the same folder as the HTML but it doesn't seem to work, I change the CSS in VSCode and nothing happens, and it seems like every adress that the server is avaible has a different CSS. Do you know what is happening?

DoomMoth
Автор

Hello sir
I had a doubt that uploading and downloading a file can be done through the express and nodejs but the condition is that the upload file must the download file, and file must not stored in the local storage or any cloud storage, please help me with the solution

-C-ARBHARADWAJ
Автор

There was a cricket player called Nasser Hussain, his name but flipped

HritikRC
Автор

Dear Hussein, What if I want not to just see the file but when I perform localhost:8080/book.png in a browser to automatically download it?

marandreslopez
Автор

This page isn’t working
localhost sent an invalid response.
ERR_INVALID_REDIRECT




*This is the result I am getting pls help.*

cadrissilver
Автор

When I creat my index.html file from the command promt I am unable to write

miketpaul