Learn about POST endpoints, parsing body JSON parameters, Postman, insertOne, and findAndModify documents in MongoDB, $push, and insertedId. Learn how to prepare response data after the database operation.
- [Instructor] To start working…on the Propose a New Name feature,…we first need to create the API endpoint…to propose a new name.…So this would be under API Index.…Right now we have three API endpoints,…and we need to add a fourth one.…So this API endpoint should be a post endpoint,…because we are creating a resource,…the API convention is to use post in that case.…And we are posting to /names,…that's the resource that we're posting to,…and we'll do a regular handler for request and response.…
That's just Express syntax.…And in here, we want to read the data…from the body parameter of Express,…because we will be sending the data…for the new name as a JSON object,…so we want to read it here,…but we have to parse it from the request.…And Express has the middleware to do that.…It's called body-parser.…And the syntax for body-parser is simple.…We just require it, and we want to use the body-parser JSON.…So let's bring in body-parser first,…with npm install body-parser,…and when that's ready, let's go to our server digest,…
- Configuring webpack and Babel
- Working with native Node modules
- Creating an Express server
- Working with React components and JSX
- Loading and working with test mock data
- Fetching data from a remote API
- Working with data in MongoDB
- Isomorphic rendering on the server
- Front-end routing and back-end routing
Skill Level Advanced
Building a Website with Node.js and Express.jswith Ray Villalobos3h 16m Intermediate
MEAN Stack and MongoDB: Development Techniqueswith Alexander Zanfir1h 48m Intermediate
1. Getting Started
2. Node as a Web Server
3. React Basics
4. Working with Data
5. Rendering on the Server
Fix the checksum problem6m 11s
6. Routing on Client and Server
7. Working with MongoDB
- 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.