To understand how Providers work in practice, we will go through the exercise of building a simple Provider of our own and adding it to our application. The Provider that we build will be a HealthcheckProvider that provides a health check route for our application and returns a success 200 status code with a JSON response, indicating that the server is running and is healthy.
To get started on building the Provider, we will create a new Swift package, publish it, and then import it into our Shopping List Vapor application. So, let's start building out first Provider by following these steps:
- Create a folder, call it HealthcheckProvider, and open the folder in the Terminal.
- Once you are in the HealthcheckProvider ...