Package dev.resteasy.vertx.server.spi


package dev.resteasy.vertx.server.spi
Public SPI for customizing the RESTEasy Vert.x embedded server.

The embedded server routes requests through a Vert.x Web Router. This package lets users supply their own router so they can add Vert.x Web middleware such as CORS handlers, session management, or authentication.

SPI Interfaces

Registration

A RouterFactory may be supplied per startup via the SeBootstrap.Configuration property RouterFactory.PROPERTY, or globally via Java's ServiceLoader. When neither is present the server uses a plain Router.router(io.vertx.core.Vertx).

Example: Per-Startup Router Factory

SeBootstrap.Configuration config = SeBootstrap.Configuration.builder()
        .property(RouterFactory.PROPERTY, (RouterFactory) vertx -> {
            Router router = Router.router(vertx);
            router.route().handler(CorsHandler.create());
            return router;
        })
        .build();
SeBootstrap.start(MyApplication.class, config);
Since:
2.0