Skip to content

avaje/avaje-jex

Repository files navigation

Discord Build JDK EA License Maven Central javadoc

avaje-jex

Javalin style wrapper over the JDK's jdk.httpserver HttpServer classes.

var app = Jex.create()
  .routing(routing -> routing
    .get("/", ctx -> ctx.text("hello"))
    .get("/one/{id}", ctx -> ctx.text("one-" + ctx.pathParam("id")))
    .filter(
        (ctx, chain) -> {
          System.out.println("before request");
          chain.proceed();
          System.out.println("after request");
        }))
  .port(8080)
  .start();