Steps to running your HTML file and other files too like CSS and JS on localhost.
( THIS IS A WINDOWS TUTORIAL. I DO NOT OWN ANY OTHER DEVICES. )
1. Download Node.js
If you already have Node.js installed you may skip to the next part.
To download Node.js open a command prompt and run it as administrator,
then type in the command
winget install OpenJS.NodeJS
after a while, you should see a confirmation. Press Y to continue and N to cancel.
After the installation you can then close the command prompt and continue to the next step.
2.
Go to the folder that includes your html file. Make sure it is named index.html
and then go to the top. You should see something that says the path
to the folder. Click on it then type CMD to open command prompt in that location.
3.
If you haven't done this before yet, you may skip if you have. Type in
npm install http-server -g
then you should get another confirmation. Again, Y to continue N to cancel.
After that, relaunch cmd prompt in the same location.
4.
Type in http-server.
5. On your computer, you can access the site by going to localhost:8080.
On other devices, it may be one of the two IP adresses that show after typing in http-server
and entering.