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)

Deploying to Production

In this section, we will learn how to deploy a production version of the app to the cloud. A common way to deploy applications is using Docker. With Docker, you can create a container that holds and runs the app.

Docker containers are portable, so once they are built, they can run on different machines or platforms. We will deploy the app to now.sh using Docker. This will make the app available on the internet so that we can share it with others.

For information on how to install Docker, you can visit the Docker Getting Started website (https://docs.docker.com/v17.09/get-started/) or the official documentation (https://docs.docker.com/).

Exercise 44: Adding a Dockerfile to our Project

In this exercise, we will add a Dockerfile to our project. Follow these steps to complete this exercise:

  1. Create a file called Dockerfile in the root of the project.
  2. Add the following contents:
    FROM node:10-alpine
    RUN mkdir -p /app/dist
    WORKDIR /app
    COPY ...