Skip to content

Instantly share code, notes, and snippets.

@rwbutler
Created January 16, 2023 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwbutler/36975c6b652ef2a73ba09e3d45f08a00 to your computer and use it in GitHub Desktop.
Save rwbutler/36975c6b652ef2a73ba09e3d45f08a00 to your computer and use it in GitHub Desktop.
HealthCheckController.swift
import Foundation
import Vapor
class HealthCheckController {
/// Returns the word 'Success' to indicate that the service is up and running.
func healthCheck(_ request: Request) throws -> Response {
return Response(status: .ok, headers: [:], body: "Success")
}
}
extension HealthCheckController: RouteCollection {
func boot(routes: RoutesBuilder) throws {
routes.get("health-check", use: healthCheck)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment