Let's now abstract the authentication code from the GET /users endpoint so it can be used with any route we create.
We're going to do this by creating our own custom middleware.
You'll recall that middleware is a hook into your request/response loop, that can transform the request or response objects. For example, we added the
Click to load comments...