使用docker 模式
- docker-compose yaml
version: '3.3'services: service1: image: rodolpheche/wiremock ports: - '9089:8080' volumes: - ./stubs:/home/wiremock/mappings
- stubs
users.json{ "request": { "method": "GET", "url": "/users" }, "response": { "status": 200, "jsonBody": [ { "name":"dalong", "appversion":"v1" }, { "name":"login", "appversion":"v1" }, { "name":"user", "appversion":"v1" } ], "headers": { "Content-Type": "application/json" } } }
- 运行
docker-compose up -dhttp://localhost:9089/users