You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
827 B

package allin.routing
import allin.model.ApiMessage
import allin.utils.AppConfig
import io.github.smiley4.ktorswaggerui.dsl.get
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
fun Application.basicRouter() {
val logManager = AppConfig.logManager
routing {
get("/", {
description = "Hello World of Allin API"
response {
HttpStatusCode.OK to {
description = "Successful Request"
}
HttpStatusCode.InternalServerError to {
description = "Something unexpected happened"
}
}
}) {
logManager.log("Routing","Get '/'")
call.respond(ApiMessage.WELCOME)
}
}
}