Skip to content

πŸ… Tomato is a RESTful HTTP web framework written in Java 8.

Notifications You must be signed in to change notification settings

LeeReindeer/Tomato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tomato

Tomato is a HTTP web framework written in Java 8.

Thanks Gin for the great design.

  • Java8 features used

  • Function Style URL Mapping

  • MVC

  • IOC

  • AOP

  • Embeded Tomcat

Get Started

public class App {

  public static void main(String[] args) {
    Tomato.init(App.class);
    Tomato.ROUTE
        .get("/ping", context -> {
          context.text("pong");
        });
    Tomato.run();
  }
}

Querystring parameters

  public static void main(String[] args) {
    Tomato.init(App.class);
    Tomato.ROUTE
        .get("/ping", context -> {
          String where = context.queryParams().getString("where");
          context.text("pong " + where);
        });
    Tomato.run();
  }

Group Route

    // api/ping
    // api/test
    // api/user/name
    // api/user/id
    // api/v2/count
    Tomato.ROUTE.group("/api")
        .get("/ping", context -> {
        })
        .put("/test", context -> {
        })
        .group("/user")
        .post("/name", context -> {
        })
        .delete("/id", context -> {
        });

    Tomato.ROUTE.group("/api/v2/")
        .put("/count/", context -> {
        });

To-dos

  • AOP

  • JSON Render

  • Exception handle

  • Radix tree based routing

About

πŸ… Tomato is a RESTful HTTP web framework written in Java 8.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages