To start adding to our new service, let's update Application.kt. When we look at Application.kt, we currently see two things. First, we have a top-level main() function that acts as the entry point for the service:
fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)
That function calls into the Netty deployment engine, which performs the work required to actually deploy our service. Netty is a network application framework that simplifies the deployment of our service. We'll look more closely at this in the next section.
The next item of interest is the Application.module() extension function. This function will be used within the deployment configuration of our service, shown as follows:
@kotlin.jvm.JvmOverloads
fun Application.module(testing: Boolean = false) {
HttpClient(Jetty) {
routing {
event()
}
}
}
It's within this function that we will actually be building our service.