It opens on but you can change the port by editing the package.json file.Do not close the command line prompt until you’re done coding in your app for the day.Lite-server is watching your files and refreshes the page as soon as you make changes to any html, js or css files.Īnd if you have VS Code configured to auto save (menu File / Auto Save), you see changes in the browser as you type! Wait a second and index.html is loaded and displayed in your default browser served by your local web server! In the same terminal window (command prompt in Windows) run this command: (Assuming you have an index.html file in your project folder). This will install lite-server (defined in package.json), a static server that loads index.html in your default browser and auto refreshes it when application files change. In a terminal window (command prompt in Windows) opened on your project folder, run this command: Add a package.json file to the project folder ![]() ![]() Somewhere in your drive, create a new folder for your web app.ģ. It comes with npm (the package manager for acquiring and managing your development libraries) The following procedure is valid for MAC or PC. Please note: this is for your Development Environment only, not Production! What works for me might not suit your need, your mileage might vary. I chose to use the following procedure, which is quite simple yet powerful. Alternatively, you can right click on the selection and choose Send selection to F Interactive. This executes the code in the F Interactive Window. Next select Send selection to F Interactive. Next, click on Edit from the top level menu. ![]() If you are building a client side SPA, such as an Angular app, it is crucial to develop and test in the context of a web server ( So nothing built-in so far, but no worries, there are at least 1 thousand way to setup a local web server. To begin using it, highlight the square function defined in your code. Visual Studio Code is a powerful and lightweight source code editor that runs on your desktop. ![]() One of the things you will find the most surprising, is that unlike its big brother Visual Studio which has IIS Express, VS Code does not come with a built-in web server… It is the start of a New Year and you have decided to try Visual Studio Code, good resolution!
0 Comments
Leave a Reply. |