Book Image

Mastering Web Application Development with Express

By : Alexandru Vladutu
Book Image

Mastering Web Application Development with Express

By: Alexandru Vladutu

Overview of this book

Table of Contents (18 chapters)
Mastering Web Application Development with Express
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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