https://kotlinlang.org logo
p

Philipp Mayer

08/24/2020, 6:23 AM
This might be a little bit naive, so excuse me, but is it possible to link js/css resources like that?
Copy code
@RestController
class IndexController {
    @GetMapping("/html")
    fun index(): String = buildString {
        appendHTML().html {
            head {
                link(rel = "stylesheet", href = "/static/styles.css", type = "text/css" )
            }
I just want to serve some static html, garnished with a little bit of css and htmx.org. What would be the proper way to achieve that? Currently, I don't really want to breach the whole door with adding react to it. Thanks in advance!
If someone stumbles over this, that's the solution:
Copy code
appendHTML().html {
            head {
                styleLink("<https://cdnjs.cloudflare.com/example.css>")
            }
10 Views