https://github.com/cn-docker/microservices-demo-golang
Microservices Demo - Golang
https://github.com/cn-docker/microservices-demo-golang
Last synced: about 2 months ago
JSON representation
Microservices Demo - Golang
- Host: GitHub
- URL: https://github.com/cn-docker/microservices-demo-golang
- Owner: cn-docker
- License: apache-2.0
- Created: 2023-07-24T10:20:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-04T22:22:34.000Z (3 months ago)
- Last Synced: 2026-03-05T04:18:54.375Z (3 months ago)
- Language: Dockerfile
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Microservices Demo
[](https://hub.docker.com/r/cnservices/microservices-demo-golang/)
[](https://hub.docker.com/r/cnservices/microservices-demo-golang/)
[](https://hub.docker.com/r/cnservices/microservices-demo-golang/)
[](https://hub.docker.com/r/cnservices/microservices-demo-golang/)
[](https://github.com/cn-docker/microservices-demo-golang)
[](https://github.com/cn-docker/microservices-demo-golang)
[](https://github.com/cn-docker/microservices-demo-golang)
[](https://github.com/cn-docker/microservices-demo-golang)
[](https://github.com/cn-docker/microservices-demo-golang)
## Build
This is a Golang app that serves a web page showing the ID of the docker container in which it is running.
To build this app, from the root of this repository just run:
docker build -t demo-go .
To create a container from that image, run:
docker run -p XXXX:8080 demo-go
You will be able to see the app going to:
localhost:XXXX
### Rest API
The app contains three Rest API.
Index - Return the served site.
localhost:XXXX
Exit Successfully - Accessing this Rest API will make the container to exit successfully.
localhost:XXXX/exitSuccess
Exit With Error - Accessing this Rest API will make the container to exit with error.
localhost:XXXX/exitWithError