Skip to content

Instantly share code, notes, and snippets.

@vacax
Last active February 23, 2021 15:59
Show Gist options
  • Save vacax/d34a56fe834f3d6ea1d48f6735c81287 to your computer and use it in GitHub Desktop.
Save vacax/d34a56fe834f3d6ea1d48f6735c81287 to your computer and use it in GitHub Desktop.
Ruta con filtro activado para todo un contexto en Javalin
Javalin app = getInstanciaJavalin();
app.routes(()->{
path("/path/", () -> {
before(ctx -> {
System.out.println("Entrando a la ruta path...");
});
get("/", ctx -> {
ctx.result("Ruta path /");
});
get("/compras", ctx -> {
ctx.result("Ruta /path/compras");
});
get("/otro", ctx -> {
ctx.result("Ruta /path/otro");
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment