use of io.quarkus.vertx.http.deployment.webjar.WebJarResultsBuildItem in project quarkus-github-app by quarkiverse.
the class GitHubAppProcessor method replayUi.
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void replayUi(GitHubAppRecorder recorder, LaunchModeBuildItem launchMode, WebJarResultsBuildItem webJarResults, HttpRootPathBuildItem httpRootPath, ShutdownContextBuildItem shutdownContext, BuildProducer<RouteBuildItem> routes, BuildProducer<NotFoundPageDisplayableEndpointBuildItem> displayableEndpoints) throws IOException {
if (launchMode.getLaunchMode() != LaunchMode.DEVELOPMENT) {
return;
}
WebJarResultsBuildItem.WebJarResult webJarResult = webJarResults.byArtifactKey(QUARKIVERSE_GITHUB_APP_GACT);
if (webJarResult == null) {
return;
}
Handler<RoutingContext> handler = recorder.replayUiHandler(webJarResult.getFinalDestination(), REPLAY_UI_PATH, webJarResult.getWebRootConfigurations(), shutdownContext);
routes.produce(httpRootPath.routeBuilder().route(REPLAY_UI_PATH).handler(handler).build());
routes.produce(httpRootPath.routeBuilder().route(REPLAY_UI_PATH + "/*").handler(handler).build());
displayableEndpoints.produce(new NotFoundPageDisplayableEndpointBuildItem(REPLAY_UI_PATH + "/"));
}
Aggregations