码迷,mamicode.com
首页 > 其他好文 > 详细

wiremock 基本docker 运行

时间:2018-08-02 00:06:19      阅读:458      评论:0      收藏:0      [点我收藏+]

标签:基本   status   one   yam   ons   display   nbsp   pve   div   

使用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 -d
http://localhost:9089/users

参考资料

http://wiremock.org/docs/

wiremock 基本docker 运行

标签:基本   status   one   yam   ons   display   nbsp   pve   div   

原文地址:https://www.cnblogs.com/rongfengliang/p/9404206.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!