O'Reilly logo

Mastering Web Application Development with Express by Alexandru Vlăduțu

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 3. Creating RESTful APIs

This chapter will guide you through building a RESTful API from scratch using Express and Mongoose. We will use a test-driven approach in the process, which means we will first create the tests and then implement the functionality. Not only will we write functional tests for the API endpoints, but we will also write unit tests for the models. In this chapter, we will cover the following topics:

  • Best practices for designing RESTful APIs
  • Writing unit tests for the models
  • Writing functional tests with Supertest
  • Versioning APIs
  • Implementing rate limiting

An overview of REST

Representational State Transfer (REST) is an architecture style for designing network applications. REST is all about resources, so when creating an ...

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