1 | git clone https://github.com/dreamhead/moco.git |
1 2 | cd <moco directory> ./gradlew build |
1 2 3 4 5 6 7 8 | [ { "response" : { "text" : "Hello, Moco" } } ] |
1 | java -jar moco-runner-<version>-standalone.jar start -p 12306 -c foo.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | { "request" : { "uri" : "/foo", "queries" : { "param" : "blah" } }, "response" : { "text" : "bar" } } |
1 | http://localhost:12306/foo?parm=blash |
1 2 3 4 5 6 7 8 9 10 11 12 13 | { "request": { "uri": { "match": "/\\w*/foo" } }, "response": { "text": "bar" } } |
1 2 3 4 5 6 7 | { "request" : { "uri" : "/redirect" }, "redirectTo" : "http://www.github.com" } |
1 2 3 4 5 6 7 8 9 10 | { "request": { "uri": "/json" }, "response": { "json": { "foo" : "bar" } } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |