Skip to content

Tantalor93/httpmockie

Repository files navigation

Go Report Card Tantalor93 License: MIT

httpmockie

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.

Installation

httpmockie can be installed using GO tooling

go install github.com/tantalor93/httpmockie@latest

Usage

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)

Docker image

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

Examples

See example for examples of usage and mock specification description.