All Projects → taichi → siden

taichi / siden

Licence: Apache-2.0 License
tiny web application framework for Java SE 8 on top of undertow.

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

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

Badges

wercker status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].