Skip to content

Instantly share code, notes, and snippets.

@kaue-silva-ifood
Created August 15, 2019 13:10
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 kaue-silva-ifood/5bb2ab09b18eaafb5477650f2a4cea9d to your computer and use it in GitHub Desktop.
Save kaue-silva-ifood/5bb2ab09b18eaafb5477650f2a4cea9d to your computer and use it in GitHub Desktop.
Application with Response object
package com.example
import io.ktor.application.*
import io.ktor.http.*
import io.ktor.response.*
import io.ktor.routing.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
fun main(args: Array<String>) {
embeddedServer(Netty, 8080) {
routing {
get("/") {
call.respond(Response (status = "OK"))
}
}
}.start(wait = true)
}
data class Response (val status: String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment