https://kotlinlang.org logo
#ktor
Title
# ktor
m

Michael

05/14/2021, 10:18 AM
Is there a way to listen on multiple ports with the HOCON config
a

Aleksei Tirman [JB]

05/14/2021, 12:43 PM
No, but you can do it with
embeddedServer
:
Copy code
fun main(args: Array<String>) {
    embeddedServer(Netty, applicationEngineEnvironment {
        connector {
            port = 8080
        }

        connector {
            port = 9090
        }

        module {
            routing {
                get("/") {
                    call.respondText { "Hello" }
                }
            }
        }
    }).start()
}
4 Views