In this video, Emmanuel Henri completes the POST endpoint so you can start adding new items to your database. Then he tests the endpoint using Postman and Robot.
- [Instructor] In this video,…we'll complete our post endpoints.…We can add new items to our database and then test it.…Let's get to it.…The first thing I want you to do is go inside…of the controllers folder and then open the controller.…The first thing we'll do is create our initial controller,…so the post one, so let's go ahead and import nongoose…from nongoose, then make sure that we important our schema.…
So, ContactSchema from where it is.…Right now it sits inside of our model, so let's go ahead…and jump out of that folder, go inside of our models folder,…and then load crmModel like so.…Then, we'll create a contact variable inside of our model,…so we'll load nongoose for that.…Model, use the function model to create the contact document…and use the ContactSchema for it.…
Basically what we're doing here is we're creating…the contact collection and leveraging the schema…that we created in the previous video for it.…And then, we'll create the function or the controller…that will add new contacts to our database.…
- 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.