8 SportsStore: deployment
This chapter covers
- Prerendering the application
- Adding progressive features
- Preparing for deployment
- Containerizing and running the deployed application
In this chapter, I prepare the SportsStore application for deployment by adding progressive features that will allow it to work while offline and show you how to prepare and deploy the application into a Docker container, which can be used on most hosting platforms.
8.1 Preparing the example application
No preparation is required for this chapter, which continues using the SportsStore project from chapter 6. To start the RESTful web service, open a command prompt and run the following command in the SportsStore folder:
npm run json
Open a second command prompt and run the following command in the SportsStore folder to start the development tools and HTTP server:
ng serve --open
Tip
You can download the example project for this chapter—and for all the other chapters in this book—from https://github.com/manningbooks/pro-angular-16. See chapter 1 for how to get help if you have problems running the examples.
8.2 Using pre-rendering
One problem with JavaScript applications is that browsers have to download some relatively large files. Not everyone has a fast and reliable network connection, and that can mean that the user is presented with an empty window while their browser gradually receives the JavaScript files that are required to start the application.