To get started, we'll just be setting up an index.html file and using a cool package called lite-server to get a lightweight server to serve our application. The cool thing is that this also comes with Browsersync which will watch our files and reload our browser when changes are detected.

We'll need an index.html file and a package.json:

# create index.html
touch index.html

# create package.json with defaults
npm init --yes

Install lite-server:

Table of Contents

    npm install --save-dev lite-server

    Create an npm script in package.json to start lite-server.

    "scripts": {
      "lite": "lite-server"

    Fill your index.html file with some data and then we can start our server up from the command line using:

    npm run lite

    You'll see your browser open with your index.html file. Try to update the index.html and watch your browser reload like it's magic!

    Chris Sevilleja

    176 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.