package dev.inmo.postssystem.features.status.server

import dev.inmo.postssystem.features.status.common.statusAuthorisedPathPart
import dev.inmo.postssystem.features.status.common.statusRootPart
import dev.inmo.micro_utils.ktor.server.configurators.ApplicationRoutingConfigurator
import io.ktor.application.call
import io.ktor.auth.authenticate
import io.ktor.http.HttpStatusCode
import io.ktor.response.respond
import io.ktor.routing.*

object StatusRoutingConfigurator : ApplicationRoutingConfigurator.Element {
    override fun Route.invoke() {
        route(statusRootPart) {
            get {
                call.respond(HttpStatusCode.OK)
            }

            authenticate {
                get(statusAuthorisedPathPart) {
                    call.respond(HttpStatusCode.OK)
                }
            }
        }
    }
}
