Created
August 15, 2019 13:10
-
-
Save kaue-silva-ifood/5bb2ab09b18eaafb5477650f2a4cea9d to your computer and use it in GitHub Desktop.
Application with Response object
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
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