```fun main() { embeddedServer(Netty, port = 8000...
# ktor
u
Copy code
fun main() {
	embeddedServer(Netty, port = 8000) {
		routing {
			get ("/") {
				call.respondText("Hello, world!")
			}
		}
	}.start(wait = true)
}
What is the ktor idiomatic way to scale this? The functional style trips me up.
Copy code
fun Route.root() {
	get ("/") {
		myLogic()
		call.respondText("Hello, world!")
	}
}

suspend fun myLogic() {
	...
}
something like this? if so, how do I then participate in DI?
Copy code
fun Route.root(graph: DI) {
	get ("/") {
		val myService = graph.get<MyService>()
		myService.myLogic()
		call.respondText("Hello, world!")
	}
}

class MyService {
	suspend fun myLogic() {
		...
	}
}
like this?
b
You can check koin
Copy code
fun Application.main() {

    // Lazy inject HelloService
    val service by inject<UserService>()

    // Routing section
    routing {
        get("/hello") {
            call.respondText(service.sayHello())
        }
    }
}