Visual Studio Code Simple Web Server

Visual Studio Code Simple Web Server

GitHub Codespaces supports Visual Studio 2019, Visual Studio Code, and modern web browsers. With your development in the cloud, seamlessly switch between tools and contribute code from anywhere, anytime. Are you looking for a free, cross-platform and highly customizable code editor? Learn VS Code!Use VS Code with React.js, full course available here: https://. Actually, this article is an alternative for 'Simple HTTP Server in C#', inspired by the great job of @David Jeske, then I can begin of coding this server system. I have made some improvements on the original source code of this http server core to facility my coding job: The 404 page. I have modified the writeFailure function. Visual Studio Subscriptions Access Visual Studio, Azure credits, Azure DevOps, and many other resources for creating, deploying, and managing applications. Power Apps A powerful, low-code platform for building apps quickly; SDKs Get the SDKs and command-line tools you need; Visual Studio App Center Continuously build, test, release, and monitor.

Features

This 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.

  • Preview on side panel (ctrl+shift+v): Open preview of HTML on side panel. With this feature, you can easely check the operation of HTML, CSS and JavaScript.
  • Launch on browser (ctrl+shift+l): Open Web Page on default browser. You can check all operation with web page.
  • Stop the web server (ctrl+shift+s): Stop the web server. This feature can be used only from command palette.
  • Resume the web server (ctrl+shift+r): Resume the web server. This feature can be used only from command palette.
  • show UI Page (ctrl+shift+u): Show UI Page. You can change options at UI page.

Extension Settings

Description

This extension contributes the following settings:

  • previewServer.browsers: Browsers to launch. Even if you do not set this option, default browser launch if the ignoreDefaultBrowser is false. Default setting is null.
  • previewServer.ignoreDefaultBrowser: Controls whether launch default browser or not. Default setting is false.
  • previewServer.isWatchConfiguration: Controls whether resume the Web Server or not, when change settings. Default setting is true.
  • previewServer.port: Port number of the Web Server. If you set null, vscode-preview-server generate random number, and set port as random number. Default setting is 8080.
  • previewServer.proxy: Set proxy. This is usefull when execute web app on another web server. Default setting is '.
  • previewServer.sync: Controls whether synchronized or not. Default setting is true.
  • previewServer.ui: Port number of UI Page. Default setting is 3001.
  • startupProject: Name of startup project. This setting is meaningful only when in the workspace. This value is the name of the folder. When using this workspace and omitting this value, the first folder becomes the startup project Default setting is null.

Simple example

Settings with workspace

How to build locally

  1. Ensure that you have gulp-cli installed globally using npm i -g gulp-cli.
  2. Run npm install to bring in the dependencies.
  3. Run gulp build to produce i18n files.
  4. Press F5 key to launch extension.

Known Issues

Preview on side panel somethimes don't work with CDN, Link etc.

Acknowledgements

This extension use browsersync.I would like to thank browsersync team for useful work.

Lisence

The AWS Toolkit for Visual Studio Code is an open source plug-in for the Visual Studio Code that makes it easier to create, debug, and deploy applications on Amazon Web Services. With the AWS Toolkit for Visual Studio Code, you will be able to get started faster and be more productive when building applications with Visual Studio Code on AWS. The toolkit provides an integrated experience for developing serverless applications, including assistance for getting started, step-through debugging, and deploying from the IDE.

Install Source Code User Guide

Get started fast

Select a quickstart serverless application template.

Click to enlargeVisual studio code web browser

Develop serverless applications easily

SimpleServer

Visual Studio Web Server Settings

Set breakpoints and debug serverless applications locally.

Click to enlarge

Deploy from the IDE

Deploy your serverless application in a few clicks.

Click to enlarge

What's new

AWS Senior Developer Advocate James Beswick blogs about how to create, debug, and deploy serverless applications with the AWS Toolkit for Visual Studio Code.

Visual Studio Code Simple Web Server

Visual Studio Code Simple Web Server Tutorial

Read our announcement post on the AWS Toolkit for Visual Studio Code