Skip to content

Commit

Permalink
hotfix: 스웨거 도입
Browse files Browse the repository at this point in the history
  • Loading branch information
hongdosan committed Dec 1, 2023
1 parent ed0a711 commit 39705ed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ dependencies {

// webflux
implementation 'org.springframework.boot:spring-boot-starter-webflux'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
}

tasks.named('test') {
Expand Down
4 changes: 2 additions & 2 deletions src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
[cols="2,5,3"]
|====
|환경 |DNS |비고
|개발(dev) | link:[dev-api.moabam.com] |
|운영(prod) | link:[api.moabam.com] |
|개발(dev) | link:[dev.moabam.com] |
|운영(prod) | link:[www.moabam.com] |
|====

[NOTE]
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/moabam/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.moabam.global.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;

@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(new Info()
.title("모아밤 프로젝트 API"));
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/moabam/global/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public PathResolver pathResolver() {
PathMapper.parsePath("/favicon/*"),
PathMapper.parsePath("/*/icon-*"),
PathMapper.parsePath("/favicon.ico"),
PathMapper.parsePath("/v3/api-docs"),
PathMapper.parsePath("/swagger*/**"),
PathMapper.pathWithMethod("/serverTime", List.of(HttpMethod.GET))))
.build();

Expand Down

0 comments on commit 39705ed

Please sign in to comment.