dave08
04/19/2018, 1:23 PMrouting { port(8080) { ... } ; port(9090) { ...} }
?Deactivated User
04/19/2018, 1:26 PMfun main(args: Array<String>) {
embeddedServer(Netty, port = 8080, module = Application::apiModule).start(wait = false)
embeddedServer(Netty, port = 9090, module = Application::internalModule).start(wait = true)
}
fun Application.apiModule() {
common()
routing {
// specific for the api
}
}
fun Application.internalModule() {
common()
routing {
// specific for internal
}
}
fun Application.common() {
routing {
// for both services
}
}
dave08
04/19/2018, 1:29 PMcy
04/19/2018, 2:34 PMcall.request.local.port
(for example, you can install an interceptor on specific route to ensure that the port is right)dave08
04/19/2018, 3:10 PMrouting { port(8080) { ... } ; port(9090) { ...} }
could be implemented... ? But then there's only one port param for embeddedServer
...