File tree 7 files changed +31
-10
lines changed
java/bio/overture/song/server/config
7 files changed +31
-10
lines changed Original file line number Diff line number Diff line change 21
21
<groupId >bio.overture</groupId >
22
22
<artifactId >song</artifactId >
23
23
<packaging >pom</packaging >
24
- <version >4.4 .0</version >
24
+ <version >4.5 .0</version >
25
25
<modules >
26
26
<module >song-core</module >
27
27
<module >song-java-sdk</module >
Original file line number Diff line number Diff line change 18
18
<parent >
19
19
<artifactId >song</artifactId >
20
20
<groupId >bio.overture</groupId >
21
- <version >4.4 .0</version >
21
+ <version >4.5 .0</version >
22
22
</parent >
23
23
<modelVersion >4.0.0</modelVersion >
24
24
35
35
<dependency >
36
36
<groupId >bio.overture</groupId >
37
37
<artifactId >song-java-sdk</artifactId >
38
- <version >4.4 .0</version >
38
+ <version >4.5 .0</version >
39
39
</dependency >
40
40
<dependency >
41
41
<groupId >bio.overture</groupId >
42
42
<artifactId >song-core</artifactId >
43
- <version >4.4 .0</version >
43
+ <version >4.5 .0</version >
44
44
</dependency >
45
45
46
46
<!-- CLI -->
Original file line number Diff line number Diff line change 19
19
<parent >
20
20
<artifactId >song</artifactId >
21
21
<groupId >bio.overture</groupId >
22
- <version >4.4 .0</version >
22
+ <version >4.5 .0</version >
23
23
</parent >
24
24
<modelVersion >4.0.0</modelVersion >
25
25
Original file line number Diff line number Diff line change 18
18
<parent >
19
19
<artifactId >song</artifactId >
20
20
<groupId >bio.overture</groupId >
21
- <version >4.4 .0</version >
21
+ <version >4.5 .0</version >
22
22
</parent >
23
23
<modelVersion >4.0.0</modelVersion >
24
24
Original file line number Diff line number Diff line change 19
19
<parent >
20
20
<artifactId >song</artifactId >
21
21
<groupId >bio.overture</groupId >
22
- <version >4.4 .0</version >
22
+ <version >4.5 .0</version >
23
23
</parent >
24
24
<modelVersion >4.0.0</modelVersion >
25
25
37
37
<dependency >
38
38
<groupId >bio.overture</groupId >
39
39
<artifactId >song-core</artifactId >
40
- <version >4.4 .0</version >
40
+ <version >4.5 .0</version >
41
41
</dependency >
42
42
43
43
<!-- Spring -->
Original file line number Diff line number Diff line change 27
27
import springfox .documentation .builders .ApiInfoBuilder ;
28
28
import springfox .documentation .service .ApiInfo ;
29
29
import springfox .documentation .spi .DocumentationType ;
30
+ import springfox .documentation .spring .web .paths .RelativePathProvider ;
30
31
import springfox .documentation .spring .web .plugins .Docket ;
31
32
import springfox .documentation .swagger .web .UiConfiguration ;
32
33
import springfox .documentation .swagger2 .annotations .EnableSwagger2 ;
@@ -42,15 +43,30 @@ public class SwaggerConfig {
42
43
@ Getter
43
44
private String alternateSwaggerUrl ;
44
45
46
+ // default is empty
47
+ @ Value ("${swagger.host:}" )
48
+ private String swaggerHost ;
49
+
50
+ // default is empty
51
+ @ Value ("${swagger.basePath:}" )
52
+ private String basePath ;
53
+
45
54
@ Bean
46
55
public Docket api () {
47
56
return new Docket (DocumentationType .SWAGGER_2 )
48
57
.apiInfo (apiInfo ())
49
58
.select ()
50
59
.apis (basePackage ("bio.overture.song.server.controller" ))
51
- .paths (any ())
52
60
.build ()
53
- .pathMapping ("/" );
61
+ .host (swaggerHost )
62
+ .pathProvider (
63
+ new RelativePathProvider (null ) {
64
+ @ Override
65
+ public String getApplicationBasePath () {
66
+ return basePath ;
67
+ }
68
+ }
69
+ );
54
70
}
55
71
56
72
@ Bean
Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ management:
80
80
81
81
swagger :
82
82
alternateUrl : " /api-docs"
83
+ # host and base url are needed if you run song behind a reverse proxy
84
+ # and rewrite the url eg: http://mydomain.com/song/swagger-ui.html
85
+ # in this case host = mydomain.com, baseUrl = /song
86
+ host : " "
87
+ basePath : " "
83
88
84
89
security.basic.enabled : false
85
90
You can’t perform that action at this time.
0 commit comments