This project is in maintenance mode. PRs and issues are welcome, but my time will be limited to defect fixes and other critical maintenance as needed.
For users looking to user ratpack and kotlin together, I recommend using the outstanding library http4k with ratpack as a server backend. More details can be found in the server backend implementation.
Build fluent kotlin ratpack applications. Features:
-
Server, Bindings, Chain, and Handler DSL
-
RxJava extension functions
-
RxJava2 extension functions
-
Reactor extension functions
-
Coroutine functions
-
Kotlin test harnessing support:
KotlinEmbeddedApp
,kotlinApplicationUnderTest(…) and friends
-
Gradle plugin (kotlin syntax)
plugins {
id("me.drmaas.ratpack-kotlin") version "x.y.z"
}
src/ratpack/ratpack.kts
import ratpack.kotlin.handling.ratpack
ratpack {
serverConfig {
port(8080)
}
bindings {
bindInstance("string")
}
handlers {
get("test") {
render(get(String::class.java))
}
}
}
All libraries are available in maven central.
Gradle
compile 'me.drmaas:ratpack-kotlin-<module>:x.x.x'
Maven
<dependency>
<groupId>me.drmaas</groupId>
<artifactId>ratpack-kotlin-<module></artifactId>
<version>x.x.x</version>
</dependency>