Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Server-Side Enterprise Development with Angular

You're reading from   Server-Side Enterprise Development with Angular Use Angular Universal to pre-render your web pages, improving SEO and application UX

Arrow left icon
Product type Book
Published in Nov 2018
Publisher
ISBN-13 9781789806267
Pages 142 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Bram Borggreve Bram Borggreve
Author Profile Icon Bram Borggreve
Bram Borggreve
Arrow right icon
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime