5 Getting Started With Live Coding
5 Getting Started With Live Coding
In this lesson, we will commence our journey of coding live web pages together.
Let's begin!
1. a code editor
2. a web server
3. a browser
We will, however, go over the basics of why the above software components
are necessary.
A code editor: #
1. RunJS widget: this allows for static coding of apps that run on HTML,
CSS, and JavaScript.
2. Live Coding Widget: this will allow for live coding with browser support.
Our app will be hosted on Educative’s preassigned host, this should look
something like the following under the Live Coding widget:
A web server #
In this course, we use Node.js because it is very easy to install, configure, and
use. With a very simple preparation step it allows live coding; as you modify
the source files, the changes are immediately reflected in the browser.
Helpful Tip
In this lesson, you will learn how to get started with Node.js, our live web
server.
Installing and using Node.js #
📜Note: If you already have experiences with Node.js and npm, you can
skip this short section.
The npm tool can install packages from a repository to your machine. These
packages can be installed globally, where all Node apps can access them, or
locally, to only your project. You can save the references to the installed
packages into a package.json file that can be used by your npm later to
update or install missing components.
The package.json defines the start command that, as its name suggests,
launches the web server and displays your page in the browser. The
index.html file is the page that is rendered in the browser.
All exercises use a copy of the very same package.json file. In the root folder,
you can find a package.json file to copy and use in your own exercise
projects.
This instruction starts the Node Package Manager that downloads the live-
server package and all its dependencies from the web and installs it globally.
Terminal
Great! Now that this is done, we’re all set and ready to start learning HTML in
the next lesson!