Generic REST endpoint that can return a payload set as an environmental variable
822
Current supported tags:
elfido/generic_rest:1.1.0 and elfido/generic_rest:latest.elfido/generic_rest:1.1.0-javaelfido/generic_rest:1.0.0.Use this image to mock other applications with no hassle.
Example of an API that will return "hello world " immediately:
docker run -d --rm -e "PAYLOAD=hello world" -p 8080:8080 elfido/generic_rest:latest
Example of an API that will return "hello world " after 250ms:
docker run -d --rm -e "SLOWAPI=true" -e "RTIME=250" -e "PAYLOAD=hello world" -p 8080:8080 elfido/generic_rest:latest
I use it a lot as part as my docker compose files. An example of usage in such environment with two dependencies for your project:
version: "2"
services:
youractualapp:
image: yourimage
links:
- "sso:sso-server"
- "dependency:another-dependency"
ports:
- "8080:8080"
depends_on:
- "sso"
- "dependency"
sso:
image: generic_rest:latest
environment:
PAYLOAD: '{"username": "fido"}'
dependency:
image: generic_rest:latest
The application will take any GET, POST, PUT and DELETE calls and will return PAYLOAD (set as an environment variable). If you want to simulate a slow call, you can hit the endpoint /slow.
Content type
Image
Digest
Size
21.3 MB
Last updated
over 9 years ago
docker pull elfido/generic_rest