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)

Building the Server

Now that both of the applications can be built, we can move on to create a simple server to host the applications.

To do this, we will create a simple Node.js server built with Nest, a framework that uses Express.js and offers great support for running Angular Universal apps. Another great benefit of Nest is that the structure and terminology is inspired by Angular, so it's easy to understand how to extend the API.

We will build the server in the folder called server in the root, create a WebPack config to build the Nest server, and add a run script so that we can build the server using a single command.

Note:

The current implementation of Angular Universal depends on Node.js as it is implemented in JavaScript. It is possible to run Angular Universal apps using other servers like ASP.NET, though under the hood, the ASP.NET server will invoke a Node.js process to handle the Angular Universal part. An example repository of how to run Angular Universal...