Skip to content

Commit

Permalink
Add basic health check route
Browse files Browse the repository at this point in the history
  • Loading branch information
lberrymage committed Oct 22, 2024
1 parent 63f22f5 commit bfac803
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import app.accrescent.parcelo.console.routes.appRoutes
import app.accrescent.parcelo.console.routes.auth.authRoutes
import app.accrescent.parcelo.console.routes.draftRoutes
import app.accrescent.parcelo.console.routes.editRoutes
import app.accrescent.parcelo.console.routes.healthRoutes
import app.accrescent.parcelo.console.routes.sessionRoutes
import app.accrescent.parcelo.console.routes.updateRoutes
import io.ktor.server.application.Application
Expand All @@ -21,6 +22,7 @@ fun Application.configureRouting() {

routing {
authRoutes()
healthRoutes()

route("/api/v1") {
sessionRoutes()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2024 Logan Magee
//
// SPDX-License-Identifier: AGPL-3.0-only

package app.accrescent.parcelo.console.routes

import io.ktor.http.HttpStatusCode
import io.ktor.resources.Resource
import io.ktor.server.application.call
import io.ktor.server.resources.get
import io.ktor.server.response.respond
import io.ktor.server.routing.Route

@Resource("/")
class Health

fun Route.healthRoutes() {
basicHealthRoute()
}

fun Route.basicHealthRoute() {
get<Health> {
call.respond(HttpStatusCode.OK)
}
}

0 comments on commit bfac803

Please sign in to comment.