This patch was authored by @AndreYonadam and released by @0xTim.
This adds the ability to perform asynchronous work in the beforeRequest
and afterResponse
closures in XCTVapor.
E.g.
try await app.test(.GET, "/hello", beforeRequest: { req async throws in
let currentUsersCount = try await User.query(on: app.db).count()
}, afterResponse: { res async throws in
let newUsersCount = try await User.query(on: app.db).count()
})