Important: This news article covers an old version of Javalin (v0.3.4).
The current version is v6.3.0.
See the documentation page for up-to-date information.
See the documentation page for up-to-date information.
You no longer need to supply a path to verbs (get
, post
, etc) in the ApiBuilder.
It makes for pretty neat APIs:
- Java
- Kotlin
app.routes(() -> {
path("users", () -> {
get(UserController::getAllUsers);
post(UserController::createUser);
path(":id", () -> {
get(UserController::getUser);
patch(UserController::updateUser);
delete(UserController::deleteUser);
});
});
});
app.routes {
path("users") {
get(userController::getAllUsers);
post(userController::createUser);
path(":id") {
get(userController::getUser);
patch(userController::updateUser);
delete(userController::deleteUser);
}
}
}
Some verbs (trace
, head
, options
, connect
) were also removed from ApiBuilder
.