Skip to content

Instantly share code, notes, and snippets.

@eduard-sukharev
Created April 18, 2017 08:37
Show Gist options
  • Save eduard-sukharev/5b4bdba102d3701fbc68d9fd4ef0ff31 to your computer and use it in GitHub Desktop.
Save eduard-sukharev/5b4bdba102d3701fbc68d9fd4ef0ff31 to your computer and use it in GitHub Desktop.
Easily mock api with wiremock docker container
{
"request": {
"method": "GET",
"urlPathPattern": "/api/blog/?"
},
"response": {
"status": 200,
"body": "[{\"id\":2,\"name\":\"Phasellus nec consectetur tellus.\",\"image\":\"http://blog.example.com/image1.jpg\",\"url\":\"//blog.example.com/post.php?id=19699828\"},{\"id\":1,\"name\":\"Duis facilisis eu metus ut placerat.\",\"image\":\"http://blog.example.com/image2.jpg\",\"url\":\"//blog.example.com/post.php?id=19644237\"}]"
}
}
docker run -d --rm -p 8080:8080 --network docker_network_name -v $PWD/api_mocks:/home/wiremock/mappings --name wiremock_api_mock rodolpheche/wiremock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment