A simple REST Service that echoes back all the request that are send to.
1M+
Simple REST Service that echos the requests back. This service runs inside a container, so there is almost no overhead in getting started.
Source: https://github.com/Vad1mo/hello-world-rest
docker run -ti --rm -p 5050:5050 vad1mo/hello-world-rest
Be patient, because it takes some time until all dependencies are downloaded and the container actually responses to requests.
> curl localhost:5050/foo/bar
/:path1/:path2 - Hello to foo/bar ! Host:0bd595c5b46a/172.18.0.3
Send request to curl localhost:5050/xx/yy and see it bouncing back.
get {
render "/ - Hello World! Host:${InetAddress.getLocalHost()}"
}
get(":name") {
render "/ - Hello $pathTokens.name! Host:${InetAddress.getLocalHost()}"
}
get("/:path1/:path2") {
render "/:path1/:path2 - Hello to $pathTokens.path1/$pathTokens.path2 ! Host:${InetAddress.getLocalHost()}"
}
get("/:path1/:path2/:path3") {
render "/:path1/:path2/:path3 - Hello to $pathTokens.path1/$pathTokens.path2/$pathTokens.path3 ! Host:${InetAddress.getLocalHost()}"
}
version: '2'
services:
#---#
proxy:
image: traefik:1.3-alpine
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG --docker.endpoint=unix:///var/run/docker.sock
ports:
- 80:80
- 443:443
labels:
- traefik.enable=false
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /dev/null:/traefik.toml
#---#
service_web:
image: vad1mo/hello-world-rest
hostname: web
labels:
- traefik.backend=web
- traefik.port=5050
- traefik.frontend.rule=Host:sample.127.0.0.1.xip.io; Path:/api/webhook, /api/token ,PathPrefix:/
- traefik.frontend.entryPoints=http
- traefik.frontend.priority = 1
#---#
service_api:
image: vad1mo/hello-world-rest
hostname: api
labels:
- traefik.backend=api
- traefik.port=5050
- traefik.frontend.rule=Host:sample.127.0.0.1.xip.io; PathPrefix:/v2/
- traefik.frontend.entryPoints=http
- traefik.frontend.priority = 10
Content type
Image
Digest
Size
137.2 MB
Last updated
over 8 years ago
docker pull vad1mo/hello-world-rest