@@ -802,25 +802,25 @@ Java::
802
802
+
803
803
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
804
804
----
805
- ClassPathResource index = new ClassPathResource("static/index.html");
806
- List<String> extensions = List.of("js", "css", "ico", "png", "jpg", "gif");
807
- RequestPredicate spaPredicate = path("/api/**").or(path("/error")).or(pathExtension(extensions::contains)).negate();
808
- RouterFunction<ServerResponse> redirectToIndex = route()
809
- .resource(spaPredicate, index)
810
- .build();
805
+ ClassPathResource index = new ClassPathResource("static/index.html");
806
+ List<String> extensions = List.of("js", "css", "ico", "png", "jpg", "gif");
807
+ RequestPredicate spaPredicate = path("/api/**").or(path("/error")).or(pathExtension(extensions::contains)).negate();
808
+ RouterFunction<ServerResponse> redirectToIndex = route()
809
+ .resource(spaPredicate, index)
810
+ .build();
811
811
----
812
812
813
813
Kotlin::
814
814
+
815
815
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
816
816
----
817
- val redirectToIndex = router {
818
- val index = ClassPathResource("static/index.html")
819
- val extensions = listOf("js", "css", "ico", "png", "jpg", "gif")
820
- val spaPredicate = !(path("/api/**") or path("/error") or
821
- pathExtension(extensions::contains))
822
- resource(spaPredicate, index)
823
- }
817
+ val redirectToIndex = router {
818
+ val index = ClassPathResource("static/index.html")
819
+ val extensions = listOf("js", "css", "ico", "png", "jpg", "gif")
820
+ val spaPredicate = !(path("/api/**") or path("/error") or
821
+ pathExtension(extensions::contains))
822
+ resource(spaPredicate, index)
823
+ }
824
824
----
825
825
======
826
826
@@ -835,16 +835,16 @@ Java::
835
835
+
836
836
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
837
837
----
838
- Resource location = new FileSystemResource("public-resources/");
839
- RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
838
+ Resource location = new FileSystemResource("public-resources/");
839
+ RouterFunction<ServerResponse> resources = RouterFunctions.resources("/resources/**", location);
840
840
----
841
841
842
842
Kotlin::
843
843
+
844
844
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
845
845
----
846
- val location = FileSystemResource("public-resources/")
847
- val resources = router { resources("/resources/**", location) }
846
+ val location = FileSystemResource("public-resources/")
847
+ val resources = router { resources("/resources/**", location) }
848
848
----
849
849
======
850
850
0 commit comments