Building your first Provider

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:

  1. Create a folder, call it HealthcheckProvider, and open the folder in the Terminal.
  2. Once you are in the HealthcheckProvider ...

Get Hands-On Full-Stack Development with Swift now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.