Skip to content

Commit 3b29e9e

Browse files
committed
swagger の導入が完了
1 parent 1ff9167 commit 3b29e9e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SpringBoot & React.js の学習用サンプルアプリケーションです
3434

3535
#### ■ アプリケーション
3636

37-
- SpringBoot 2.7
37+
- SpringBoot 2.5
3838
- React 18
3939
- Typescript
4040
- Bootstrap 4
@@ -420,6 +420,12 @@ Dockerを起動後に以下のURLにアクセスすると利用可能です。
420420

421421
http://localhost:8983/
422422

423+
### Swagger
424+
作成したAPIの一覧を確認したりデータを検索できます。<br>
425+
フロントを起動後に以下のURLにアクセスすると利用可能です。
426+
427+
http://localhost:8080/swagger-ui/
428+
423429
## 🔗 参考
424430

425431
| プロジェクト| 概要|

web-front/src/main/java/com/isystk/sample/web/front/SwaggerConfig.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.isystk.sample.web.front;
22

3+
import java.util.Collections;
34
import org.springframework.context.annotation.Bean;
45
import org.springframework.context.annotation.Configuration;
56

@@ -18,10 +19,11 @@ public Docket api() {
1819
.select()
1920
// // パッケージを指定して表示するAPIを絞り込む
2021
// .apis(RequestHandlerSelectors.basePackage("com.isystk.sample.web.front.controller.api.v1"))
21-
// .paths(PathSelectors.any())
22-
// パスを指定して絞り込むこともできる
22+
// パスを指定して絞り込む
2323
.paths(PathSelectors.ant("/api/v1/**"))
2424
.build()
25+
.protocols(Collections.singleton("https"))
26+
.host("localhost")
2527
.apiInfo(apiInfo());
2628
}
2729

0 commit comments

Comments
 (0)