alexmclarty / mirror

A simple app for mock API creation
3 stars 0 forks source link
api fake mock python testing

Mirror

A simple app that allows you to create mock endpoints on the fly which can be useful for testing APIs.

Also includes some endpoints useful for testing Open ID Connect integrations.

How to run

Build the docker image with:

docker build -t mirror .

and run a container with:

docker run -p 6001:6001 mirror

The app will be available at localhost:6001.

To run locally setup a virtual environment, activate and install dependencies with pip install -r requirements.txt. app.py is the entrypoint.

Environment variables

Running tests

Run:

docker run mirror python tests.py

Test output will be on the command line.

How to use

{
  "endpoint": "/cheese",
  "methods": ["GET"],
  "status_code": 200,
  "json_response": [{"type": "cheese"}]
}

Fake Open ID routes here:

See https://connect2id.com/learn/openid-connect for more information.

Enjoy programmatic mock API creation!

TODO