Skip to Content
Getting MEAN with Mongo, Express, Angular, and Node
book

Getting MEAN with Mongo, Express, Angular, and Node

by Simon Holmes
November 2015
Intermediate to advanced content levelIntermediate to advanced
440 pages
13h 27m
English
Manning Publications
Content preview from Getting MEAN with Mongo, Express, Angular, and Node

Chapter 6. Writing a REST API: Exposing the MongoDB database to the application

This chapter covers

  • Rules of REST APIs
  • API patterns
  • Typical CRUD functions (create, read, update, delete)
  • Using Express and Mongoose to interact with MongoDB
  • Testing API endpoints

As we come in to this chapter we have a MongoDB database set up, but we can only interact with it through the MongoDB shell. During this chapter we’ll build a REST API so that we can interact with our database through HTTP calls and perform the common CRUD functions: create, read, update, and delete.

We’ll mainly be working with Node and Express, using Mongoose to help with the interactions. Figure 6.1 shows where this chapter fits into the overall architecture.

Figure 6.1.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Getting MEAN with Mongo, Express, Angular, and Node video edition

Getting MEAN with Mongo, Express, Angular, and Node video edition

Simon Holmes

Publisher Resources

ISBN: 9781617292033Supplemental ContentPublisher SupportOtherPublisher WebsiteErrata PagePurchase Link