您的位置:首页 > 其它

moco 搭建接口mock环境入门

2017-04-10 18:26 211 查看
>>> git clone https://github.com/dreamhead/moco.git
>>> download Standalone Moco Runner

>>> 写配置:

四种配置分别对应:
http://localhost:12306/foo?param=blash" http://localhost:12306/aabb/foo" http://localhost:12306/redirect http://localhost:12306/json

[
{
"request" :
{
"uri" : "/foo",
"queries" :
{
"param" : "blash"
}
},
"response" :
{
"text" : "bar"
}
},
{
"request":
{
"uri":
{
"match": "/\\w*/foo"
}
},
"response":
{
"text": "bar by re url"
}
},
{
"request" :
{
"uri" : "/redirect"
},
"redirectTo" : "http://www.github.com"
},
{
"request":
{
"uri": "/json"
},
"response":
{
"json": {"foo" : "bar"}
}
}
]

>>> 批处理启动(自检测配置更新重新启动)

java -jar moco-runner-0.11.0-standalone.jar http -p 12306 -c test.json


参考:
https://www.ibm.com/developerworks/cn/web/1405_liugang_mocowebtest/ https://github.com/dreamhead/moco
一张图看git命令 链接
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  moco mock api