A Spark DSL in idiomatic kotlin.
- Per Wendel, @perwendel
- Love Löfdahl, @lallemupp
Maven:
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-kotlin</artifactId>
<version>1.0.0-alpha</version>
</dependency>
Gradle:
compile "com.sparkjava:spark-kotlin:1.0.0-alpha"
http.get("/hello") {
"Hello Spark Kotlin"
}
http.get("/nothing") {
status(404)
"Oops, we couldn't find what you're looking for"
}
http.get("/saymy/:name") {
params(":name")
}
http.get("/redirect") {
redirect("/hello")
}