Skip to content

Instantly share code, notes, and snippets.

@nikolajakshic
Created May 30, 2018 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikolajakshic/0a7ea29a53fab557e40deb14d7d201be to your computer and use it in GitHub Desktop.
Save nikolajakshic/0a7ea29a53fab557e40deb14d7d201be to your computer and use it in GitHub Desktop.
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