Proof-of-Concept (PoC) application that returns a name. It is indented to be called by another application that composes a "Greeting name!" output.
For example for "Hello world!" this app would be the one providing the "world".
The purpose of this application is to be used for microservices tech demos and example implementations of tools.
It is in no way, shape, or form a reference for best practices, a good example, or a comprehensive anything. It is a minimal skeleton app with simple logic that can easily be extended.
For more complex demos see:
- Google Cloud Platform's microservices-demo
- Microsoft's eShopOnContainers
- Weaveworks' and Container Solutions' Sock Shop
- Istio's BookInfo
- Kubernetes' Guestbook
- The open-source, multi-language medium.com clones
This repository is configured with support for GitPod for easy development.
Local application commands:
go build -o app # to build the app
go test # to run the tests
./app # to run the app (if not already running)
Docker commands:
docker run --interactive --tty --rm \
--publish 5003:5003 \
public.ecr.aws/poc-hello-world/namer-service:latest
Endpoints exposed by the application:
# curl -v http://localhost:5003
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET / HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Accept, Accept-Language, Content-Type, X-Version, X-Reply-Service
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Origin: *
< Content-Type: application/json
< X-Reply-Service: namer-service
< X-Version: dev
< Date: Thu, 1 Apr 1000 10:10:09 GMT
< Content-Length: 17
<
{"name":"world"}
# curl -v http://localhost:5003/status/alive
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET /status/alive HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Accept, Accept-Language, Content-Type, X-Version, X-Reply-Service
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Origin: *
< Content-Type: application/json
< X-Reply-Service: namer-service
< X-Version: dev
< Date: Thu, 1 Apr 1000 10:10:10 GMT
< Content-Length: 38
<
{"status":"Namer service is alive"}
# curl -v http://localhost:5003/status/heathy
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET /status/healthy HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Accept, Accept-Language, Content-Type, X-Version, X-Reply-Service
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Origin: *
< Content-Type: application/json
< X-Reply-Service: namer-service
< X-Version: dev
< Date: Thu, 1 Apr 1000 10:10:11 GMT
< Content-Length: 40
<
{"status":"Namer service is healthy"}
This repository is fork-friendly!
- fork this repository
- go to the "Actions" tab and enable GitHub Actions
- setup relevant secrets
- to build and push a container image to Amazon ECR
AWS_ACCESS_KEY_ID
looking something likeAKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY
looking something likewJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
- to build and push a container image to Amazon ECR
- change relevant values in
.github/workflows/app-build-and-push.yaml
- change something in the code and create a new Pull Request
If you extend this application to do something, please create a Pull Request back with a link to your fork.
Fork link | Extras added |
---|---|
+ dynamically read name from DynamoDB |
This project is provided under the MIT License. See LICENSE for more information.