Skip to content

Instantly share code, notes, and snippets.

@digimon1740
Created October 23, 2019 13:38
Show Gist options
  • Save digimon1740/2fac01621da4bf7d45bcf2737658d356 to your computer and use it in GitHub Desktop.
Save digimon1740/2fac01621da4bf7d45bcf2737658d356 to your computer and use it in GitHub Desktop.
var app = Javalin.create(config -> {
config.defaultContentType = "application/json";
config.autogenerateEtags = true;
config.addStaticFiles("/public");
config.asyncRequestTimeout = 10_000L;
config.dynamicGzip = true;
config.enforceSsl = true;
}).routes(() -> {
path("users", () -> {
get(UserController::getAll);
post(UserController::create);
path(":user-id"(() -> {
get(UserController::getOne);
patch(UserController::update);
delete(UserController::delete);
});
ws("events", userController::webSocketEvents);
});
}).start(port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment