mock-http-server

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 14 Imported by: 0

README

mock-http-server

Code Analysis GitHub tag (latest SemVer)

A simple HTTP Server to be used for the unit or end-to-end or integrations tests.

  • yaml based configuration, see an example config file.
  • docker image is published in this repo and on the docker hub

Usage

docker run -p 8080:8080 -v $(pwd)/example_config.yaml:/config.yaml -e CONFIG=config.yaml ghcr.io/sv-tools/mock-http-server:latest

in second shell

curl http://localhost:8080/users -H"X-Request-Id: 123"
> {"id":1,"name":"John","id":2,"name":"Jane"}

curl http://localhost:8080/users/1 -H"X-Request-Id: 123"
> {"id":1,"name":"John"}

License

MIT licensed. See the bundled LICENSE file for more details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL