Created
May 30, 2018 14:24
-
-
Save nikolajakshic/0a7ea29a53fab557e40deb14d7d201be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.ktor.application.Application | |
import io.ktor.application.call | |
import io.ktor.application.install | |
import io.ktor.features.ContentNegotiation | |
import io.ktor.gson.gson | |
import io.ktor.request.receive | |
import io.ktor.routing.post | |
import io.ktor.routing.routing | |
fun Application.module() { | |
install(ContentNegotiation) { | |
gson { setPrettyPrinting() } | |
} | |
routing{ | |
post("items"){ | |
val items = call.receive<List<Item>>() | |
val item = items[0] | |
} | |
} | |
} | |
data class Item(val name: String) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment