Hi! I'm playing around with the router dsl and its...
# spring
p
Hi! I'm playing around with the router dsl and its working great so far. However, I want to set up my Controller which handles thymeleaf too. I got this GET Endpoint:
Copy code
@GetMapping("/")
    fun index(model: Model): String {
        model.addAttribute(....)
        return "index"
    }
and I would like to convert it to the new dsl.
Copy code
router {
        accept(MediaType.TEXT_HTML).nest {
            GET("/") { index(/*model param missing*/) }
        }
Could one give me a hint how to handle the parameter
model: Model
accordingly? Thanks a lot!
j
Never used the API, but given its documentation, it would be something like this:
Copy code
GET("/") {
            ok().render("index", mapOf("someAttribute" to "someValue"))
        }