Skip to content

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

License

Notifications You must be signed in to change notification settings

coconautti/spark-kotlin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 96.9%
  • Java 2.9%
  • HTML 0.2%