|
|
|
@ -803,7 +803,7 @@ Java:: |
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
---- |
|
|
|
---- |
|
|
|
ClassPathResource index = new ClassPathResource("static/index.html"); |
|
|
|
ClassPathResource index = new ClassPathResource("static/index.html"); |
|
|
|
List<String> extensions = List.of("js", "css", "ico", "png", "jpg", "gif"); |
|
|
|
List<String> extensions = Arrays.asList("js", "css", "ico", "png", "jpg", "gif"); |
|
|
|
RequestPredicate spaPredicate = path("/api/**").or(path("/error")).or(pathExtension(extensions::contains)).negate(); |
|
|
|
RequestPredicate spaPredicate = path("/api/**").or(path("/error")).or(pathExtension(extensions::contains)).negate(); |
|
|
|
RouterFunction<ServerResponse> redirectToIndex = route() |
|
|
|
RouterFunction<ServerResponse> redirectToIndex = route() |
|
|
|
.resource(spaPredicate, index) |
|
|
|
.resource(spaPredicate, index) |
|
|
|
|