Summary
In this chapter, we did a lot of coding. Previously, we mainly relied on the admin panel or the CLI to generate the API for us. This is amazing and one of the reasons we love Strapi – we can build 80% of our system with a few clicks on a slick UI. This chapter was about the 20% of use cases when the default is not enough, and when we want to customize the API to do a bit more or a bit less.
We dug deeper into how an API is built in Strapi by exploring the concepts of routes, controllers, services, models, and the model life cycle. We learned how to add new routes and how to map them to controllers that make use of services. We also explored some security considerations, such as sanitizing sensitive data. We learned how to disable default core endpoints, which can come in handy when we don't want to expose a certain operation.
We also looked at how to customize the API by using the model life cycle hooks, which provide us with a level of integration that&apos...