Introducing Javalin
Javalin is a very lightweight web framework for Kotlin and Java, inspired by Sparkjava and koa.js. Javalin is written in Kotlin with a few functional interfaces written in Java. This was necessary to provide an enjoyable and near identical experience for both Kotlin and Java developers.
Java quickstart Add dependency (maven)
<dependency>
<groupId>io.javalin</groupId>
<artifactId>javalin</artifactId>
<version>1.0.0</version>
</dependency>
Start programming
import io.javalin.Javalin;
public class HelloWorld {
public static void main(String[] args) {
Javalin app = Javalin.start(7000);
app.get("/", ctx -> ctx.result("Hello World"));
}
}
Kotlin quickstart
Add dependency (gradle)
compile 'io.javalin:javalin:1.0.0'
Start programming
import io.javalin.Javalin
fun main(args: Array<String>) {
val app = Javalin.start(7000)
app.get("/") { ctx -> ctx.result("Hello World") }
}
Special thanks:
Blake Mizerany, for creating Sinatra
Per Wendel, for creating Spark
Christian Rasmussen, for being a great guy
Per Kristian Kummermo, also for being a great guy
Download: javalin-master.zip
or
git clone https://github.com/tipsy/javalin.git
Sources:
https://javalin.io/news/javalin-1.0.0-stable.html
https://github.com/tipsy/javalin