simple standalone high-performance mock HTTP server implemented in GO, which is able to provide mocked responses defined by mock specifications similar to Wiremock JSON API.
httpmockie
accepts endpoint specifications specified as JSON files (format described in specification) in a single directory.
You can configure endpoint path, HTTP status, response bodies and headers. Endpoints can be also configured to respond after configurable delay.
httpmockie
can be installed using GO tooling
go install github.com/tantalor93/httpmockie@latest
Usage:
httpmockie [flags]
Flags:
-d, --dir string directory with mock specifications (default ".")
-h, --help help for httpmockie
-p, --port int port to run mock server on (default 8081)
you can also run httpmockie
as Docker container, for example:
docker run -p 8081:8081 -v $(pwd)/docs/examples/:/specs tantalor93/httpmockie:v0.0.1 --dir /specs
See example for examples of usage and mock specification description.