「仮想サーバ/docker/MockApiサーバ」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==dockerでMockApiサーバを作成== go言語で作られたmockAPIサーバー jordimartin/mmockを使う。 dockerhubのmmock:https://hub.docker.com/r/jordimartin/...」) |
|||
| 行1: | 行1: | ||
| − | == | + | ==mmockでサーバを作成== |
go言語で作られたmockAPIサーバー jordimartin/mmockを使う。 | go言語で作られたmockAPIサーバー jordimartin/mmockを使う。 | ||
| 行5: | 行5: | ||
参考:https://qiita.com/Ryo478468/items/4a959c5d7312045f471c | 参考:https://qiita.com/Ryo478468/items/4a959c5d7312045f471c | ||
| + | |||
| + | ==Swaggerapiでサーバー作成== | ||
| + | <pre> | ||
| + | docker pull swaggerapi/swagger-ui | ||
| + | docker run -d -p 8090:8080 swaggerapi/swagger-ui | ||
| + | </pre> | ||
| + | |||
| + | 以下でswagger-uiのapi設定のAPIリストが出る | ||
| + | |||
| + | ttp://localhost:8090 | ||
| + | |||
| + | ===変更したい場合=== | ||
| + | #/pet/findByStatusを開いて、try it outを選択 | ||
| + | #availableを選択 | ||
| + | |||
| + | requestに https://petstore.swagger.io/v2/pet/findByStatus?status=available とでるので、表示するとxmlが出る。 | ||
| + | |||
| + | 参考:https://qiita.com/aucfan-engineer/items/5532fcf69b4f4dcd1c41 | ||
2021年1月28日 (木) 21:20時点における版
mmockでサーバを作成
go言語で作られたmockAPIサーバー jordimartin/mmockを使う。
dockerhubのmmock:https://hub.docker.com/r/jordimartin/mmock
参考:https://qiita.com/Ryo478468/items/4a959c5d7312045f471c
Swaggerapiでサーバー作成
docker pull swaggerapi/swagger-ui docker run -d -p 8090:8080 swaggerapi/swagger-ui
以下でswagger-uiのapi設定のAPIリストが出る
ttp://localhost:8090
変更したい場合
- /pet/findByStatusを開いて、try it outを選択
- availableを選択
requestに https://petstore.swagger.io/v2/pet/findByStatus?status=available とでるので、表示するとxmlが出る。
参考:https://qiita.com/aucfan-engineer/items/5532fcf69b4f4dcd1c41
