Skip to Main Content
Write Modern Web Apps with the MEAN Stack: Mongo, Express, AngularJS, and Node.js
book

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

by Jeff Dickey
September 2014
Intermediate to advanced content levelIntermediate to advanced
256 pages
5h 25m
English
Peachpit Press
Content preview from Write Modern Web Apps with the MEAN Stack: Mongo, Express, AngularJS, and Node.js

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Node.js, MongoDB, and AngularJS Web Development

Node.js, MongoDB, and AngularJS Web Development

Brad Dayley

Publisher Resources

ISBN: 9780133962369Purchase book