File tree Expand file tree Collapse file tree
java/com/api/advanced_mobile/global/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import io .swagger .v3 .oas .models .OpenAPI ;
55import io .swagger .v3 .oas .models .info .Info ;
66import io .swagger .v3 .oas .models .servers .Server ;
7+ import org .springframework .beans .factory .annotation .Value ;
78import org .springframework .context .annotation .Bean ;
89import org .springframework .context .annotation .Configuration ;
910
1011import java .util .List ;
1112
1213@ Configuration
1314public class SwaggerConfig {
15+
16+ @ Value ("${server.servlet.context-path:/}" )
17+ private String contextPath ;
18+
1419 @ Bean
1520 public OpenAPI openAPI () {
1621 Info info = new Info ()
1722 .title ("API Document" )
1823 .version ("v0.0.1" )
1924 .description ("API 명세서입니다." );
2025
21- Server server = new Server ();
22- server .setUrl ("https://api.13.209.194.63.nip.io" );
26+ Server httpsServer = new Server ();
27+ httpsServer .setUrl ("https://api.13.209.194.63.nip.io/api" );
28+ httpsServer .setDescription ("HTTPS Server" );
2329
2430 return new OpenAPI ()
2531 .info (info )
26- .servers (List .of (server ));
32+ .servers (List .of (httpsServer )) // HTTPS만 명시
33+ .components (new Components ());
2734 }
2835}
Original file line number Diff line number Diff line change 11package com .api .advanced_mobile .global .config ;
22
3+ import org .springframework .context .annotation .Configuration ;
34import org .springframework .web .servlet .config .annotation .CorsRegistry ;
45import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
56
7+ @ Configuration
68public class WebConfig implements WebMvcConfigurer {
79
810 @ Override
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ spring.jpa.open-in-view: false
1515server.servlet.session.timeout =60m
1616
1717# swagger
18- springdoc.api-docs.enabled =true
19- springdoc.swagger-ui.enabled =true
20- springdoc.swagger-ui.config-url =/api/v3/api-docs/swagger-config
18+ springdoc.swagger-ui.url =/api/v3/api-docs
19+ springdoc.api-docs.path =/v3/api-docs
20+ springdoc.swagger-ui.operationsSorter =method
21+ springdoc.swagger-ui.disable-swagger-default-url =true
You can’t perform that action at this time.
0 commit comments