1.moco就是一个可执行的jar包,从https://www.sohu.com/a/227982419_106784 下载,然后配置好配置文件,直接在终端执行,此时moco服务器就起来了
2.moco在请求url和参数接收的地方是支持java的regex的,详细使用:
{
"description": "合并档案",
"request": {
"uri": { "match": "/list/[0-9]{1,}$" },
"method": "put",
"queries": {
"page": { "match": "[0-9]{1,}" },
"perpage": { "match": "[0-9]{1,}" }
}
},
"response": {
"json": {
"respCode": "10000000",
"respMessage": "SUCCESS",
"respMark": "SUCCESS"
}
}
}
3.配置文件可分而治之即可以配置一个全局的配置然后将其他配置文件作为这个全局配置文件的子配置文件引入即可(具体参考文档)
4.官方源码即文档:https://github.com/dreamhead/moco