coleca / api-mock

Run api-mock service in docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API-Mock Docker image

Run a api-doc application in docker.

Document your API in the API blueprint format, and API-Mock mocks your routes and sends the responses defined in the api spec.

See more about the application: https://github.com/localmed/api-mock

This has been modified to work with Kubernetes secrets located in /etc/secrets/api.md

Example to run without Kubernetes:



## Example

api.md

```markdown
# /messages

Retrieve messages

## GET
+ Response 200 (text/plain)

        Hello World!
        Hello Other World


# /messages/{id}
Represents a particular message by it's *id*.

## Retrieve message [GET]
+ Response 200 (text/plain)

        Hello World!

## DELETE MESSAGE DELETE
+ Response 204

# /messages/{id}.json

## Retrieve message in JSON [GET]
+ Response 200 (application/json)

        {"message": "Hello World!"}

Run in shell:

$  docker run -ti --rm -v $PWD/api.md:/app/api.md -p 3000:3000 ajnasz/api-mock

Then to test by calling a GET request:

$ curl -v localhost:3000/messages/123

There you can see the response

Then to test by calling a DELETE request:

$ curl -v -X DELETE localhost:3000/messages/123

About

Run api-mock service in docker


Languages

Language:API Blueprint 100.0%