Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning Server-Side Application Development with Angular

You're reading from   Beginning Server-Side Application Development with Angular Discover how to rapidly prototype SEO-friendly web applications with Angular Universal

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher
ISBN-13 9781789342161
Length 110 pages
Edition 1st Edition
Languages
Tools
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

Implementing a Web Server


Now that both our applications can be built, we can move on to creating a simple server to host our applications.

In order to do this, we will create a simple Node.js server based on Express.js.

We will define our server in a TypeScript file called server.ts and run this file using the ts-node binary that we will install.

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, such as ASP.NET, although 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 can be found here: https://github.com/MarkPieszak/aspnetcore-angular2-universal.

Installing Server Dependencies

We will install the ts-node binary that we will use to execute our server file. Additionally, we will install the rendering engine that will be used by Express.js to load our 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 $19.99/month. Cancel anytime