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