Skip to content

Instantly share code, notes, and snippets.

@Nublo
Last active February 5, 2020 14:59
Show Gist options
  • Save Nublo/32b0929b35ff7f67fe45e60a4ffc8be0 to your computer and use it in GitHub Desktop.
Save Nublo/32b0929b35ff7f67fe45e60a4ffc8be0 to your computer and use it in GitHub Desktop.
fun Application.main() {
// DefaultHeaders adds date and server headers to each response, allowing you to expand with additional data if necessary
install(DefaultHeaders)
// CallLogging – adds logging of responses/queries
install(CallLogging)
// routing – responsible for routing queries and, in our case, uses DSL to formulate a response
routing {
get("/") {
call.respondHtml {
head {
title { +"Ktor on Google App Engine standard environment" }
}
body {
p {
+"Hello there! This is Ktor running on App Engine standard environment"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment