In this video, Emmanuel Henri completes the GET endpoint with an ID so you can start pulling specific contacts from your database. Then he tests the endpoint using Postman and Robot.
- [Instructor] What if you need to retrieve…just the information of a specific user.…This is when a specific ID endpoint comes into play.…Lets get to it.…So the first thing I want you to do, again,…is go inside of the controllers.…And we'll create a new controller.…So let's go ahead and do export,…constant.…And this one we'll do get contact with ID.…
And same as before, request, response.…And this is a function so we'll pass these two items…and we'll find, so this is a function…that comes with Mongoose and Mongo.…Find by idea.…And you see, because I have auto complete and…most of the commands that come with the Mongo…are in here.…I can do find by ID, just like so.…
And in the request object…we'll be able to pass the params and the contact ID.…Once we make our request,…we'll be able to pass the contact ID here…inside of our request.…So once we get into our controller,…in the request and the params…we'll be able to grab that contact ID…and therefore find data based off that ID.…And then we'll do the same as we've done before.…
- Setting up a project and a server
- Setting up a database and schema
- Creating POST, GET, PUT, and DELETE endpoints
- Serving files
Skill Level Intermediate
Node.js: Extend and Maintain Applicationswith Daniel Khan3h 35m Intermediate
Node.js: Build Your First Microservicewith Daniel Khan2h 9m Intermediate
1. Setting Up
2. Initial Server Build
3. CRUD Operations
4. Other API Options
Static files serving3m 16s
Next steps1m 1s
- 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.