Chapter 8. Adding Routing and Client Authentication

In the previous chapter, you saw how to build up an authentication API with Node and Express. Now, you will take that code and integrate it into your application. The goal is that when you are complete, only users will be able to make posts, and the posts will be linked to the currently logged-in user.

Routing

Before you can build up the pages for authentication, you’ll need to include Angular’s router. Angular has a module you can add to your app and turn it into a single-page application. Angular will be able to show different views based on the URL.

Before you get started with that, let’s rename the layout file layouts/posts.html to layouts/app.html. This is because your layout file will ...

Get Write Modern Web Apps with the MEAN Stack: Mongo, Express, AngularJS, and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.