• Moco使用简单指导


    下载地址

    需要java运行环境支持。下载jar包:moco-runner-<version>-standalone.jar

    配置文件

    下面是参考:

    配置

    Moco的配置文件格式使用的是json。例如:

    [
      {
        "response" :
          {
            "text" : "Hello, Moco"
          }
      }
    ]

    请求响应配置

    {
      "request" :
        {
          "uri" : "/foo"
        },
      "response" :
        {
          "text" : "bar"
        }
    }

    多文件配置

    [
        {
            "include" : "foo.json"
        },
        {
            "include" : "bar.json"
        }
    ]
    其中,foo.json和bar.json都是包含服务的配置文件。启动参数必须使用-g。
    
    
    [
        {
            "request": {
                "method": "post",
                "uri": "/tenants/login",        
                "forms":  {
                    "email": "guiyun.wei@pekall.com",
                    "password": "123"
                }
            },
            "response": {
                "json": {
                    "status": 0,
                    "uid": 1            
                }
            }
        },
        {
            "request": {
                "method": "post",
                "uri": "/tenants/login",        
                "forms":  {
                    "email": "guiyun.wei@pekall.com",
                    "password": "1234"
                }
            },
            "response": {
                "json": {
                    "status": 1        
                }
            }
        },
        {
            "request": {
                "method": "post",
                "uri": "/tenants/logout",        
                "forms":  {
                    "email": "guiyun.wei@pekall.com"
                }
            },
            "response": {
                "json": {
                    "status": 0        
                }
            }
        }
    ]    
    ------------------------------------------------------------------------------------------------------------------------------------------ 需要荷兰版牛栏、荷兰美素、母婴用品的攻城师、设计师朋友,欢迎关顾【七彩母婴店】【http://qicaoyun.taobao.com】。凡是从博客园得知信息的,全店商品,均可优惠,请告知客服哦。你也可以通过淘代码【D5867219】,在淘宝搜索到我们。收藏有礼哦!
  • 相关阅读:
    BZOJ1093: [ZJOI2007]最大半连通子图
    BZOJ4033: [HAOI2015]树上染色
    BZOJ1977: [BeiJing2010组队]次小生成树 Tree
    BZOJ4944: [Noi2017]泳池
    BZOJ1269: [AHOI2006]文本编辑器editor
    BZOJ4596: [Shoi2016]黑暗前的幻想乡
    BZOJ1815: [Shoi2006]color 有色图
    BZOJ1488: [HNOI2009]图的同构
    BZOJ3527: [Zjoi2014]力
    Salazar Slytherin's Locket CodeForces
  • 原文地址:https://www.cnblogs.com/javawer/p/3596426.html
Copyright © 2020-2023  润新知