Philipp Mayer
08/20/2023, 6:20 PMdave
08/20/2023, 6:25 PMMikael Ståldal
08/27/2023, 7:41 AMhtmxWebjar()webJars()dave
08/27/2023, 8:39 AMval app = routes(
        htmxWebjars(),
        "/" bind GET to routes(
            // Respond to htmx powered requests
            Request.isHtmx bind { Response(OK).with(view of Time(Date())) },
            // Standard requests get routed to here
            orElse bind { Response(OK).with(view of Index) }
        )
    )Mikael Ståldal
08/27/2023, 9:11 AMMikael Ståldal
08/27/2023, 9:34 AMRequest.isHtmxdave
08/27/2023, 9:38 AMMikael Ståldal
08/27/2023, 3:37 PMhttp4k-corewebJarsimport org.http4k.routing.ResourceLoader
import org.http4k.routing.static
fun webjar(name: String, version: String) =
    static(ResourceLoader.Classpath("/META-INF/resources/webjars/$name/$version/dist"))htmxWebjars(),
        webjar("bootstrap", "5.3.0")<dependency>
            <groupId>org.http4k</groupId>
            <artifactId>http4k-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.http4k</groupId>
            <artifactId>http4k-htmx</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>bootstrap</artifactId>
            <version>5.3.0</version>
        </dependency>dave
08/27/2023, 3:43 PM