A minimal HTTP mock server
Content-Type indentificationContent Types are identified based on the syntax used in response. Currently supported types:
application/json for {"status":1}application/xml for "<status>1</status>"text/plain for "anything else"Both standalone and docker usage of this mock server require a valid conf file. Here is an example of such a JSON config file:
{
"/hello":{
"GET": {"sc":200,"response":"Hello, World!"},
"POST": {"sc":201}
},
"/how":{
"POST": {"sc":200, "response": {"status":1}}
},
"/are":{
"POST": {"sc":200, "response": "<status>1</status>"}
},
"/you":{
"POST": {"sc":200, "headers": {"server":"nginx"}}
}
}
YAML confs can also be used. Here is the equivalent of the previous one
/hello:
GET:
sc: 200
response: Hello, World!
POST:
sc: 201
/how:
POST:
sc: 200
response:
status: 1
/are:
POST:
sc: 200
response: <status>1</status>
/you:
POST:
sc: 200
headers:
server: nginx
Docker usage requires that files, not matter the type, are mounted on /conf
python /path/to/server.py 5000 /path/to/config.json
docker run -p 8080:5000 -v /path/to/config.json:/conf:ro zar3bski/mock_tepee:amd64-latest
Content type
Image
Digest
Size
45 MB
Last updated
about 6 years ago
docker pull zar3bski/mock_tepee:arm64v8-1.0.0