Simple and efficient HTTP mock server with specification written in yaml, edn or OpenAPI.
💾 Download the binary with the latest version of moclojer to test on your computer here.
📖 See the complete documentation for moclojer here, if you want to contribute (or complement) the documentation, it is here.
YAML example
# This mock register route: GET /hello/:username
- endpoint:
# Note: the method could be omitted because GET is the default
method: GET
path: /hello/:username
response:
# Note: the status could be omitted because 200 is the default
status: 200
headers:
Content-Type: application/json
# Note: the body will receive the value passed in the url using the
# :username placeholder
body: >
{
"hello": "{{path-params.username}}!"
}- image:
ghcr.io/moclojer/moclojer:dev - port (default):
8000, if you want to change the port set the environment variablePORT
docker run -it \
-p 8000:8000 -v $(pwd)/moclojer.yml:/app/moclojer.yml \
ghcr.io/moclojer/moclojer:dev
we Two available versions:
dev: main branch docker imagelatest: latest stable version image
bash < <(curl -s https://raw.githubusercontent.com/moclojer/moclojer/main/install.sh)
If you are using Linux you maybe need
sudo.
clj -M:run [OPTIONS]java -jar moclojer.jar [OPTIONS]moclojer_Linux [OPTIONS]
Config path or the CONFIG environment variable. [Default: moclojer.yml]
OpenAPI v3 mocks path or the MOCKS environment variable.
Show help information
Show version information
We use git submodule to integrate with OpenAPI v3 specification, if you want to use it, you will need to update the git submodule code.
git submodule update -f --init
clj -M:run
clj -M:test
clj -A:dev -M --report stderr -m moclojer.build