Question App in Nodejs, Pug,Redirects and Cookie Practice

Lesson Summary

In this lesson we look at integrating redirects into our question app. We learn that a redirect simply takes a user to another page we specify. This may be our desired outcome when we want to be sure that our app's visitor has logged in. If he has not logged in we want to be able to redirect them to a login page. In this specific lesson we look at using the username cookie we set and navigate the user to our /hello route if they have not set it, and to the index route if they have set their name which greets them with a welcome message and then their name.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required