O'Reilly logo

Write Modern Web Apps with the MEAN Stack: Mongo, Express, AngularJS, and Node.js by Jeff Dickey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required