xurshid29 / spark-kotlin

A Spark DSL in idiomatic kotlin // dependency: com.sparkjava:spark-kotlin:1.0.0-alpha

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spark-kotlin

A Spark DSL in idiomatic kotlin.

Authors:

  • Per Wendel, @perwendel
  • Love Löfdahl, @lallemupp

Dependency:

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"

Syntax:

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")
}

About

A Spark DSL in idiomatic kotlin // dependency: com.sparkjava:spark-kotlin:1.0.0-alpha

License:Apache License 2.0


Languages

Language:Kotlin 96.9%Language:Java 2.9%Language:HTML 0.2%