>>> 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命令 链接