Hey, I'm trying to get SSE working with Javalin (6.4.0) and kotlin. this is the code
fun main() {
var app = Javalin.create().start(7070)
app.get("/"){
it.result("hello world from SSE app!")
}
app.sse("/sse") { client ->
client.sendEvent("connected", "Hello, SSE")
client.onClose { println("Client disconnected") }
client.close() // close the client
}
println("Hello World!")
}
- this is not hitting sse part, I breakpointed it and put a log inside the handler
- should the SSE not be returning content-type text/event-stream, I am getting back text/plain
Not sure where I am going wrong, any help would be appreciated.
Hey, I'm trying to get SSE working with Javalin (6.4.0) and kotlin. this is the code
Not sure where I am going wrong, any help would be appreciated.