Skip to content

Commit

Permalink
Merge pull request #58 from mkouba/do-not-register-route-if-no-templates
Browse files Browse the repository at this point in the history
Do not register a route if there are no templates to serve
  • Loading branch information
mkouba committed Nov 15, 2023
2 parents c3c375b + 3df005c commit 623e373
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public void collectTemplatePaths(TemplateFilePathsBuildItem templateFilePaths,
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
public RouteBuildItem produceTemplatesRoute(QuteWebRecorder recorder, List<QuteWebTemplatePathBuildItem> 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)
Expand Down

0 comments on commit 623e373

Please sign in to comment.