Declaring API endpoints and managing the errors
Fastify lets you use the software architecture you like most. In fact, this framework doesn’t limit you from adopting Representation State Transfer (REST), GraphQL, or simple Application Programming Interfaces (APIs). The first two architectures standardize the following:
- The application endpoints: The standard shows you how to expose your business logic by defining a set of routes
- The server communication: This provides insights into how you should define the input/output
In this chapter, we will create simple API endpoints with JSON input/output interfaces. This means that we have the freedom to define an internal standard for our application; this choice will let us focus on using the Fastify framework instead of following...