edit

Server backend

Installation (Gradle)

SunHttp (for development only): compile group: "org.http4k", name: "http4k-core", version: "2.35.1"

Jetty: compile group: "org.http4k", name: "http4k-server-jetty", version: "2.35.1"

Netty: compile group: "org.http4k", name: "http4k-server-netty", version: "2.35.1"

Undertow: compile group: "org.http4k", name: "http4k-server-undertow", version: "2.35.1"

About

Server-backend modules provide a consistent API mount HttpHandlers into the specified container in 1 LOC, by simply passing a ServerConfig implementation (in this case Jetty):

{ request: Request -> Response(OK).body("Hello World") }.asServer(Jetty(8000)).start().block()

Alteratively, all server-backend modules allow for plugging http4k handlers into the relevant server API, which allows for custom Server configuration.