Skip to content

Commit

Permalink
Merge pull request #69 from traP-jp/feat/mock-server
Browse files Browse the repository at this point in the history
feat:mockサーバーを立ち上げるコマンドを作成
  • Loading branch information
mathsuky authored Nov 25, 2024
2 parents ef81a5f + d3cd9d6 commit 8108990
Show file tree
Hide file tree
Showing 4 changed files with 1,771 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ coverage

*.tsbuildinfo

src/api
src/api/generated
2 changes: 1 addition & 1 deletion scripts/gen-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
docker run --rm -v "$(dirname $0)/../:/local" -u $(id -u):$(id -g) openapitools/openapi-generator-cli generate \
-i https://raw.githubusercontent.com/traP-jp/traO-Judge-docs/refs/tags/1.1.0/api/backend/frontend-backend.yaml \
-g typescript-fetch \
-o /local/src/api
-o /local/src/api/generated
7 changes: 7 additions & 0 deletions scripts/run-mock-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eux

# スクリプトのディレクトリを基準にパスを設定
SCRIPT_DIR=$(dirname "$0")

# Dockerコンテナをバックグラウンドで起動し、指定された設定ファイルを使用してモックサーバーを立ち上げる
docker run --rm -d --mount type=bind,source="${SCRIPT_DIR}/../src/api/mock/front-back-api-mock.json",target=/data,readonly -p 4010:4010 mockoon/cli:latest -d /data -p 4010
Loading

0 comments on commit 8108990

Please sign in to comment.