semji / mockservr

Mockservr is an API mocking system, allowing to configure endpoints, specifying requests details and responses.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mockservr

travis status Docker Pulls

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 (docker image 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.

Quickstart

Run Mockservr with Docker

docker run -p 8080:80 -p 4580:4580 -v /mocks-directory:/usr/src/app/mocks rvip/mockservr

Access Mockservr browser

Mockservr comes with an embedded web based object browser.

Default web browser url : http://localhost:4580.

Run Hello World

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 !"
    }
  ]
}

Go to http://localhost:8080/hello/world

Full documentation

Read the docs

About

Mockservr is an API mocking system, allowing to configure endpoints, specifying requests details and responses.


Languages

Language:JavaScript 97.6%Language:Makefile 1.0%Language:Dockerfile 0.8%Language:HTML 0.6%