Mock Server for development or testing purposes using Yaml configuration
128
Links:
Technologies:
This project is a mock HTTP server that can be used to simulate different HTTP responses. Let me list you some use cases:
The server uses a configuration file to define the routes and the responses that it should return. The configuration file is a YAML file that contains the following fields:
endpoints:
- name: <string>
request:
methods:
- GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD
paths:
- <regex>
headers:
<string>: <string>
response:
delay: <integer> # In milliseconds
status: <HTTP_STATUS> # OK | CREATED | BAD_REQUEST | ...
headers:
<string>:
- <string>
body: # Only one field of body can be used
# You can use the | character to write a multiline string
string: <string>
file: <string>
Notes: See the examples directory for more information
The following example uses the configuration file basic-example.yml from the examples directory,
if you want to use another configuration file, you need to change the HEAVY_MOCK_CONFIG environment variable
and make sure that the file is in the /configs directory bound to the container
version: '3.8'
services:
heavy-mock-http-server:
image: heavynimbus/heavy-mock-http-server:0.0.1
ports:
- "8080:80"
environment:
- HEAVY_MOCK_CONFIG=/configs/single-endpoint.yml # The configuration file that the server should use
volumes:
- type: bind
source: ./examples
target: /configs
read_only: true
Content type
Image
Digest
sha256:b34d4a03a…
Size
277.5 MB
Last updated
about 2 years ago
docker pull heavynimbus/heavy-mock-http-server:0.1.0