Skip to content
Snippets Groups Projects
Select Git revision
  • 9ff49bbc3a9950d7d1c8ca34b93497e07d0b3686
  • main default protected
  • apiv2
3 results

Routing.kt

Blame
  • Routing.kt 671 B
    package space.rethelyi.web
    
    import io.ktor.application.*
    import io.ktor.response.*
    import io.ktor.routing.*
    import space.rethelyi.floors
    import space.rethelyi.model.toResponseV1
    import space.rethelyi.model.toResponseV2
    
    fun Application.configureRouting() {
        routing {
            get("/app") {
                call.respondRedirect("https://play.google.com/store/apps/details?id=space.rethelyi.mosogepsch")
            }
            get("/api/v2") {
                call.respond(mapOf("floors" to floors.map { it.value.toResponseV2() }))
            }
    
            get("/api/v1/laundry-room/") {
                call.respond(mapOf("floors" to floors.map { it.value.toResponseV1() }))
            }
        }
    }