20 lines
506 B
Kotlin
20 lines
506 B
Kotlin
package eu.maiora.routes
|
|
|
|
import eu.maiora.model.ResidenzeRepositoryImpl
|
|
import io.ktor.server.application.*
|
|
import io.ktor.server.auth.*
|
|
import io.ktor.server.response.*
|
|
import io.ktor.server.routing.*
|
|
|
|
|
|
fun Route.residenze(residenzeRepository: ResidenzeRepositoryImpl){
|
|
route("/api/residenze"){
|
|
authenticate("auth-jwt") {
|
|
get(){
|
|
val listaResidenze = residenzeRepository.listaResidenze()
|
|
call.respond(listaResidenze)
|
|
}
|
|
}
|
|
|
|
}
|
|
} |