With this extension you can create a simple http server and preview your html.
When a client connects to a server, it sends a GET request to upgrade the connection to a WebSocket from a simple HTTP request. This is known as handshaking. This sample code can detect a GET from the client. Note that this will block until the first 3 bytes of a message are available. Visual Studio has intellisense and has nice support for plug-ins, but is bulky. While, Visual Studio Code is a fast, powerful multi-language IDE with out of the box front-end development, but is a.
Create a HTTP server and edit your website while your Website will reload, either in your Browser or in Visual Studio Code, both works too!Other people can join you aswell, when your TCP port is forwarded, and you give your friends your external IP address.
How To Use
Press F1 and run the commands
'Simple HTTP Server: Create HTTP Server'
After a HTTP Server has been created, and you can open the Website in Visual Studio Code or in your Browser, both works too!When editing the files they will refresh when you save the file, if other people are on your website too, it'll refresh for them aswell!
When starting a HTTP Server without a single file make sure you are in the current directory with the main file, by default it is the 'index.html' file.If this file is in the root directory of your current project you can start the HTTP Server without any problems.
'Simple HTTP Server: Create HTTP Server With Current File'
This will be always the same function as the normal create HTTP Server. The difference is that you do not have to navigate into a folder.You can launch a single file with this command with no futher requrements.
When starting a HTTP server with a single file make sure that the current file is saved on your computer, it can't be a Untitled file in Visual Studio Code.So just save it on your computer and it'll work!
'shs.serverPort'
This is the port that the HTTP server will be running on, and the port you need to use to access your website.
'shs.serverHost'
This is the host that the HTTP server will be running on, it'll be like '0.0.0.0', '127.0.0.0' and so on, if set to '0.0.0.0' other people can view your website too, given that they know your external IP address and your TCP port is forwarded.
'shs.mainFile'
This is the main file for the HTTP server, for example the 'index.html' if is differently the HTTP server will serve that as the main file.
Visual Studio Code Simple Web Server Download
This is a example of the Visual Studio Code HTML Preview.
Visual Studio Code Web Server
This is a example of the Browser HTML Preview.
License
See Repository
Microsoft Visual Studio Code
FeaturesThis extension provide preview of HTML which execute on web server.When you save files, this extension automatically reload browser or side panel (live preview feature).You can call these features from the context menu or editor menu.The main features are as follows.
Extension SettingsDescriptionThis extension contributes the following settings:
Simple exampleSettings with workspaceHow to build locally
Known Issues
AcknowledgementsThis extension use browsersync.I would like to thank browsersync team for useful work. Lisence |