Siden
tiny web application framework for Java SE 8 on top of undertow.
Install / Use
/learn @taichi/SidenREADME
Siden
tiny web application framework for Java SE 8.
Siden focus on writing your application quickly and running server more faster.
Getting Started
Write simple java application
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.
Add dependency to your build.gradle
apply plugin: 'java'
repositories.jcenter()
dependencies {
compile 'ninja.siden:siden-core:0.6.0'
}
sourceCompatibility = targetCompatibility = 1.8
Run and View
http://localhost:8080/hello
WebSocket Example
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);
}
}
License
Apache License, Version 2.0
Inspired projects
- http://expressjs.com/
- http://www.sinatrarb.com/
- http://www.sparkjava.com/
- http://flask.pocoo.org/
Badges
Related Skills
node-connect
334.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
334.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.2kCommit, push, and open a PR
