Languages

JavaScript / HTML - how can I run file on http://localhost?

3 points
Asked by:
jarlh
635

I'm working with web workers and I want to run my website on http://localhost.

How can I do it instead of being opened under a specified path like C:/example/path/index.html?

My project structure:

JavaScript / HTML - how can I run index.html file on localhost?
JavaScript / HTML - how can I run index.html file on localhost?
1 answer
3 points
Answered by:
jarlh
635

In Visual Studio Code, there's a Live Server extension.

1. You can go to Extensions and search for "Live Server".

VS Code - Live Server extension
VS Code - Live Server extension

2. Install it, and then you can right-click your index.html file to open it with Live Server.

VS Code - Open file with Live Server
VS Code - Open file with Live Server

Result:

JavaScript / HTML - run file on localhost
JavaScript / HTML - run file on localhost
0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join