https://github.com/mamorum/kaze
Java simple web app framework.
https://github.com/mamorum/kaze
java java-framework java-web
Last synced: 28 days ago
JSON representation
Java simple web app framework.
- Host: GitHub
- URL: https://github.com/mamorum/kaze
- Owner: mamorum
- Archived: true
- Created: 2016-07-04T16:44:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-05-20T20:46:57.000Z (over 3 years ago)
- Last Synced: 2024-04-21T19:54:10.568Z (almost 2 years ago)
- Topics: java, java-framework, java-web
- Language: Java
- Homepage:
- Size: 370 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Kaze: Java simple web app framework
## Features
- Easy to create RESTful API, Web API, etc
- Runs on servlet containers
- Supports embedded Jetty (Optional)
- Minimal dependencies (Only Servlet API)
## Hello World Example
### 1. Add Maven dependencies
```xml
com.github.mamorum
kaze
1.0.0
org.eclipse.jetty
jetty-servlet
9.4.6.v20170531
```
### 2. Create code
```java
package kaze.sample.gs.html;
import kaze.App;
import kaze.opt.Jetty;
// app -> http://localhost:8080/app/hello
// doc -> http://localhost:8080/*
public class Main {
public static void main(String[] args) {
App app = new App();
app.get("/hello", (req, res) -> {
res.html("
Hello, World.
");
});
Jetty.app(app, "/app/*");
Jetty.doc("/public", "/");
Jetty.listen(8080);
}
}
```
### 3. Run
```
gs> mvn compile
gs> mvn exec:java -Dexec.mainClass=kaze.sample.gs.html.Main
```
### 4. Check
```
> curl -s -X GET http://localhost:8080/app/hello
Hello, World.
```
## Examples
- [gs](https://github.com/mamorum/kaze-sample/tree/master/gs): basic examples (above and json response).
- [rdb](https://github.com/mamorum/kaze-sample/tree/master/rdb): web app accessing relational database, packaged as fatjar.
- [war](https://github.com/mamorum/kaze-sample/tree/master/war): web app for servlet container, packaged as war.
## Requirements
- Java 8
- Servlet 3.1
- Jetty 9.4.6 (Optional)
And compatible higher versions.
## Build Status
- [Travis CI](https://travis-ci.org/mamorum/kaze)