simple http mock server.
config.sample.json
is here.
$ mimic --config=config.sample.json
2014/08/29 15:15:38 registered: GET /
2014/08/29 15:15:38 registered: POST /api/message
2014/08/29 15:15:38 registered: GET /api/message
2014/08/29 15:15:38 mimic server started at localhost:3390
$ curl -X POST http://localhost:3390/api/message
{"status":"ok"}% -- 2014/08/29 15:16:30 --
$ curl -X GET http://localhost:3390/api/message
{"message":"Hi, I'm mimic!!"}% -- 2014/08/29 15:16:35 --
$ curl -X GET http://localhost:3390/hoge
404 page not found
Download binary for your environment from release page
and place it in $PATH
directory.
Please run mimic --help
.
{
"rules": [
{
"method" : "GET",
"path" : "/",
"content" : "hello"
}
]
}
config.sample.json will help you.