Book Image

Server-Side Enterprise Development with Angular

By : Bram Borggreve
Book Image

Server-Side Enterprise Development with Angular

By: Bram Borggreve

Overview of this book

With the help of Server-Side Enterprise Development with Angular, equip yourself with the skills required to create modern, progressive web applications that load quickly and efficiently. This fast-paced book is a great way to learn how to build an effective UX by using the new features of Angular 7 beta, without wasting efforts in searching for referrals. To start off, you'll install Angular CLI and set up a working environment, followed by learning to distinguish between the container and presentational components. You'll explore advanced concepts such as making requests to a REST API from an Angular application, creating a web server using Node.js and Express, and adding dynamic metadata. You'll also understand how to implement and configure a service worker using Angular PWA and deploy the server-side rendered app to the cloud. By the end of this book, you'll have developed skills to serve your users views that load instantly, while reaping all the SEO benefits of improved page indexing.
Table of Contents (5 chapters)

Configuring the Service Worker

In the previous section, we added the service worker configuration file, src/ngsw-config.json, to our project, but we have not configured anything yet.

In this section, we will add two types of configuration, asset groups and data groups. We will use a fairly straightforward configuration for our service worker. Please refer to the service worker configuration page for a detailed description of the configuration options in ngsw-config.json.

Exercise 47: Configuring Asset Groups

In this exercise, we will append two items to the asset groups configuration. In the asset groups configuration, we will specify how we want our service worker to handle the assets of the application.

When we talk about assets, we think of stylesheets, images, and external JS files. The first asset group caches the data that comes from the domains that we use to fetch our CSS and the fonts included in that CSS. The second asset group caches the static data from the...