Created
January 16, 2023 15:54
-
-
Save rwbutler/36975c6b652ef2a73ba09e3d45f08a00 to your computer and use it in GitHub Desktop.
HealthCheckController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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