O'Reilly logo

Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Consuming a REST API: Using an API from inside Express

This chapter covers

  • Calling an API from an Express application
  • Handling and using data returned by the API
  • Working with API response codes
  • Submitting data from the browser back to the API
  • Validation and error traps

This chapter is an exciting one! Here’s where we tie the front end to the back end for the first time. We’ll remove the hard-coded data from the controllers, and end up showing data from the database in the browser instead. On top of this we’ll push data back from the browser into the database via the API, creating new subdocuments.

The technology focus for this chapter is on Node and Express. Figure 7.1 shows where this chapter fits into the overall architecture ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required