jkbbwr
02/27/2018, 11:34 AMcy
02/27/2018, 11:41 AMjkbbwr
02/27/2018, 11:42 AMfun Application.main() {
install(CallLogging)
routing {
get("/") {
call.respondText("""Hello, world!<br><a href="/bye">Say bye?</a>""", ContentType.Text.Html)
}
get("/bye") {
call.respondText("""Good bye!""", ContentType.Text.Html)
}
}
}
fun Http(host: String, port: Int) = embeddedServer(Netty, host = host, port = port, module=Application::main)
`
I have a SendChannel<Any>
that I want exposed to routes. so I can then call
channel.send("test")
for examplecy
02/27/2018, 11:49 AMjkbbwr
02/27/2018, 12:16 PMcy
02/27/2018, 12:22 PMval facade = startEventConsumer(this)
cy
02/27/2018, 12:23 PMinstall(MyEventBus)
and that could be retrieved via application.feature(MyEventBus)
jkbbwr
02/27/2018, 12:30 PMjkbbwr
02/27/2018, 12:34 PMfun Http(host: String, port: Int) = embeddedServer(Netty, host = host, port = port) {
install(CallLogging)
routing {
get("/") {
call.respondText("""Hello, world!<br><a href="/bye">Say bye?</a>""", ContentType.Text.Html)
}
get("/bye") {
call.respondText("""Good bye!""", ContentType.Text.Html)
}
}
}