In this exercise, you must make a new router for the tigers module, and then mount that router in the application alongside the lions module.
(funky music)…- So, we have a new objective.…So, if you look at this one,…if you go into server, server.js,…the file we've been working out of.…First you'll notice there's two more files.…There's a lines.js. There's a tigers.js.…Alright, there's two more files.…So, at the to do at the top…it says to mount the tigers route with a new router.…A A.…Just for tigers. Exactly like the lions is below.…So, if you go down here.…I have the apps middleware,…and then I'm doing mounting right here.…
I'm like, okay, if anybody does a request,…any verb to this route,…use the lionRouter.…So, where did the lionRouter come from?…Well let's follow it.…lionRouter right here,…it's being required from lions file.…So let's go in the lions file.…Boom.…The first thing I did was I made a lionRouter.…This is all filled out for you,…you will not be working in this file.…I made a lionRouter…and then the rest of the stuff is the exact same…stuff we had on the last example…with the only change of getting rid of app…and attaching all the functionality…
This course was created by Frontend Masters. It was originally released on 12/30/2015. We're pleased to host this training in our library.
- Executing Node.js
- Using Express
- What is middleware?
- Testing in Node.js
- Using Mongo with Node.js
- Data modeling
- Querying data with Mongoose
- Identifying sensitive routes
- Configuring the deployment
Skill Level Intermediate
Node.js: Build Your First Microservicewith Daniel Khan2h 9m Intermediate
Building APIs Using Hapi in Node.jswith Kirsten Hunter2h 23m Intermediate
2. REST APIs
5. Organization and Configuration
7. Data Modeling
10. Securing Routes
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.