Mockservr is an API mocking system, allowing to configure endpoints, specifying requests details and responses.
Some of Mockservr key features:
- YAML or JSON endpoint configuration
- Ability to use Apache Velocity Template files to dynamically adapt responses to requests parameters
- Official image maintained under docker hub (
rvip/mockservr) to ease integration into a development or test stack
Mockservr is designed to be as user-friendly as possible, hence it can be integrated into an existing stack really quickly, immediately providing a way to mock APIs.
docker run -p 8080:80 -p 4580:4580 -v /mocks-directory:/usr/src/app/mocks rvip/mockservr
Mockservr comes with an embedded web based object browser.
Default web browser url : http://localhost:4580.
Put sample config mock below in /mocks-directory
on your host.
hello-world.mock.yaml
http:
-
request: "/hello/world"
response: "Hello World !"
hello-world.mock.json
{
"http": [
{
"request": "/hello/world",
"response": "Hello World !"
}
]
}