Start table view

This commit is contained in:
2020-04-24 00:15:58 +02:00
parent 3bfe09817b
commit feeee20bfe
5 changed files with 131 additions and 22 deletions
+7 -3
View File
@@ -8,15 +8,19 @@ import io.ktor.response.*
import io.ktor.routing.*
import org.kodein.di.Kodein
import org.kodein.di.generic.instance
import kotlin.system.measureTimeMillis
fun Routing.notes(kodein: Kodein) {
val notesService by kodein.instance<NotesService>()
authenticate {
get("/notes") {
val userId = call.userId()
val notes = notesService.getNotes(userId)
call.respond(notes)
val time = measureTimeMillis {
val userId = call.userId()
val notes = notesService.getNotes(userId)
call.respond(notes)
}
application.log.info("Time taken: $time ms")
}
}
}