tiny web application framework for Java SE 8.
Siden focus on writing your application quickly and running server more faster.
import ninja.siden.App;
public class Main {
public static void main(String[] args) {
App app = new App();
app.get("/hello", (req, res) -> "Hello world");
app.listen();
}
}
if you want to more examples, see example/Main.java.
apply plugin: 'java'
repositories.jcenter()
dependencies {
compile 'ninja.siden:siden-core:0.6.0'
}
sourceCompatibility = targetCompatibility = 1.8
http://localhost:8080/hello
import java.nio.file.Paths;
import ninja.siden.App;
public class UseWebsocket {
public static void main(String[] args) {
App app = new App();
app.get("/", (q, s) -> Paths.get("assets/chat.html"));
app.websocket("/ws").onText(
(con, txt) -> con.peers().forEach(c -> c.send(txt)));
app.listen(8181);
}
}
Apache License, Version 2.0