Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Express Basics!
You have completed Express Basics!
Preview
Put some of what you've learned about redirects to practice.
Steps to implement the feature in this challenge
- Add a form with a goodbye button to the welcome page.
- Create a new route called goodbye for the form to post to
- Clear the cookie in the new route
- Redirect the user to the hello form
Clearing a Cookie in Express
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Because we want this behavior to
happen when we visit the index route.
0:00
The route handler that handles the root
route, is where we need to add the logic.
0:03
Here in the app.js in the index route,
0:12
I made an if statement
checking the value of name.
0:15
If it exists,
we want to render the index template,
0:20
otherwise redirect to the hello route.
0:25
Now I want to present you
with another challenge,
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up