Serving HTML Pages Locally from VS Code
Serving HTML Pages Locally from VS Code#
VS Code with the
LiveServer plugin to launch a local development server with live reloading for web development.
Statement of need#
Web development can be a time-consuming and tedious process, especially when it comes to testing and previewing changes. VSCode LiveServer comes in handy providing a seamless way to run a local server and preview updates in real-time within the VSCode editor, saving valuable time and reducing the potential for errors. Setting up is very easy.
Get VS Code#
Visual Studio Code has its own instructions to download and install it (see here).
Chocolatey provides a convenient to install VIsual Studio Code by just typing
choco install vscode
Open VS Code, open the prompt by typing
P. Then enter the following to install
ext install ritwickdey.liveserver
Init the Live Server#
Now a live server can be initiated from an
HTML file in
VS Code by pressing
A “live” server will now be opened in the default browser.
Everytime a new change is saved, this will be reflected in the live server.