Video Course

Getting Started with Angular v4: Lesson 3 of 26

Setup

Up Next

TypeScript Setup

Autoplaying in 7 seconds!

Cancel

Create a Free Account to Watch

Sign Up Now

Login to your account

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:

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

157 posts

Co-founder of Scotch.io. Slapping the keyboard until something good happens.