From 3df005cea4ac82afe9546b6a0241b7558afb4c04 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Wed, 15 Nov 2023 08:16:52 +0100 Subject: [PATCH] Do not register a route if there are no templates to serve --- .../io/quarkiverse/qute/web/deployment/QuteWebProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deployment/src/main/java/io/quarkiverse/qute/web/deployment/QuteWebProcessor.java b/deployment/src/main/java/io/quarkiverse/qute/web/deployment/QuteWebProcessor.java index 6d6791f6..b2b4eaa4 100644 --- a/deployment/src/main/java/io/quarkiverse/qute/web/deployment/QuteWebProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/qute/web/deployment/QuteWebProcessor.java @@ -69,6 +69,10 @@ public void collectTemplatePaths(TemplateFilePathsBuildItem templateFilePaths, @Consume(SyntheticBeansRuntimeInitBuildItem.class) public RouteBuildItem produceTemplatesRoute(QuteWebRecorder recorder, List templatePaths, HttpRootPathBuildItem httpRootPath, QuteWebBuildTimeConfig config) { + if (templatePaths.isEmpty()) { + // There are no templates to serve + return null; + } return httpRootPath.routeBuilder() .routeFunction(httpRootPath.relativePath(config.rootPath() + "/*"), recorder.initializeRoute()) .handlerType(config.useBlockingHandler() ? HandlerType.BLOCKING : HandlerType.NORMAL)