{"id":38100994,"url":"https://github.com/mvenkatesh431/go-rest-api","last_synced_at":"2026-01-16T21:12:20.532Z","repository":{"id":64304036,"uuid":"489483680","full_name":"mvenkatesh431/go-rest-api","owner":"mvenkatesh431","description":"Simple GO Lang Rest API Service to work with Kubernetes and Docker.","archived":false,"fork":false,"pushed_at":"2022-05-20T21:09:17.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T14:17:18.511Z","etag":null,"topics":["docker","go","golang","kubernetes","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvenkatesh431.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-06T20:21:14.000Z","updated_at":"2024-06-20T14:17:18.512Z","dependencies_parsed_at":"2023-01-15T10:15:45.409Z","dependency_job_id":null,"html_url":"https://github.com/mvenkatesh431/go-rest-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mvenkatesh431/go-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvenkatesh431%2Fgo-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvenkatesh431%2Fgo-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvenkatesh431%2Fgo-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvenkatesh431%2Fgo-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvenkatesh431","download_url":"https://codeload.github.com/mvenkatesh431/go-rest-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvenkatesh431%2Fgo-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","go","golang","kubernetes","rest-api"],"created_at":"2026-01-16T21:12:19.749Z","updated_at":"2026-01-16T21:12:20.526Z","avatar_url":"https://github.com/mvenkatesh431.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Simple GO Rest API:\n\nThis project contains a simple GOLang rest API service. This service is useful to test the Kubernetes and Docker.\n\nWe also packaged it as a Docker Image. We used mutli stage build to create the small docker image. and **The size of the image is very small. It's just 12.4 MB.**\nYou can pull it from docker hub using below command.\n```\ndocker pull mvenkatesh431/k8s-test-container\n```\n## API Details:\nWe are using the Gorilla Mux and Following routes are implemented\n\n- `/info` - Returns the info about the request.\n- `/health-check` - Returns JSON response as `True` if the service is running fine. We can also add custom delay by setting the `HEALTHDELAY` Environment variable.\n- `/env` - Returns present container environment variables in JSON format.\n- `/quote` - Returns a Random Quote from the `quotes.json` file.\n\n\n## How to Run:\n\nClone the repo and run the `main.go` using the `go run`\n\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go\n2022/05/07 17:35:37 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/07 17:35:52 Entering /info endpoint, Invoked from 127.0.0.1:56541\n2022/05/07 17:43:10 Entering /info endpoint, Invoked from 127.0.0.1:56541\n2022/05/07 17:47:42 Entering /health-check endpoint, Invoked from 127.0.0.1:56541\n2022/05/07 17:49:04 Entering /env endpoint, Invoked from 127.0.0.1:56541\n2022/05/07 17:49:27 Entering /env endpoint, Invoked from 127.0.0.1:56541\n2022/05/07 17:49:56 Entering /health-check endpoint, Invoked from 127.0.0.1:56541\n2022/05/07 17:54:52 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 17:54:52 Yeah We alll shine on, Like the Moon, and the Stars, And the SUN. - John Lennon\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \n....\n```\n\nBy default server listens on `10000` Port on `all Interfaces (0.0.0.0)` of node. Goto the `127.0.0.1:10000/info` from your browser or by using the `curl`.\n\n## Running using the Docker:\nPlease look at the [Running on Docker](https://github.com/mvenkatesh431/go-rest-api#running-on-docker) section\n\n## Running using Kubernetes(K8s):\nPlease look at the [Running on Kubernetes](https://github.com/mvenkatesh431/go-rest-api#running-on-kubernetes) section\n\n### `/info` Endpoint output:\n```\n{\"Endpoint\":\"/info\",\"Host\":\"127.0.0.1:10000\",\"Method\":\"GET\",\"RemoteIP\":\"127.0.0.1:54326\",\"Version\":\"1.0.0\"}\n```\n\n### Curl Example:\n```\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/info\n\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Endpoint\":\"/info\",\"Host\":\"127.0.0.1:10000\",\"Method\":\"GET\",\"RemoteIP\":\"127.0.0.1:54417\",\"Version\":\"1.0.0\"}\n```\n\n### `/health-check` endpoint:\nThis `/health-check` route, Returns `healthy:true` if server is running fine. So we can see the status of the server by monitoring this route. This can be used with the Kubernetes Readiness and Liveness probes.\nWe can also add custom delay by setting the `HEALTHDELAY` environment variable.\n\n```\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/health-check\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"healthy\":true}\n...\n```\n\n### `/env` endpoint:\n\nThis `/env` route dumps the all environment variables\n\n```\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/env\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Version\":\"1.0.0\",\"env\":\"ALLUSERSPROFILE=C:\\\\ProgramData,\n                    APPDATA=C:\\\\Users\\\\mvenk\\\\AppData\\\\Roaming,\n                    CommonProgramFiles=C:\\\\Progr...\n```\n\n### `/quote` endpoint:\n\nThis `/quote` route will generate random quote. We use the `quotes.json` file, which contains the list of quotes with author names. You can pass your own `json` quotes file to override the quotes.\n\n```\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Yeah We alll shine on, Like the Moon, and the Stars, And the SUN. - John\n                    Lennon\",\"Version\":\"1.0.0\"}\n\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Yeah We alll shine on, Like the Moon, and the Stars, And the SUN. - John\n                    Lennon\",\"Version\":\"1.0.0\"}  \n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"If my mind can conceive it, if my heart can believe it, then I can achieve it. -\n                    Muhammad Ali\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"The best and most beautiful things in the world cannot be seen or even touched - they\n                    must be felt with the heart. - Helen Keller\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"The only way to learn a new programming language is by writing programs in it. - Dennis\n                    Ritchie\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Life is like riding a bicycle. To keep your balance, you must keep moving. - Albert\n                    Einstein\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Life is like riding a bicycle. To keep your balance, you must keep moving. - Albert\n                    Einstein\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Yeah We alll shine on, Like the Moon, and the Stars, And the SUN. - John\n                    Lennon\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Any fool can write code that a computer can understand. Good programmers write code that\n                    humans can understand. - Martin Fowler\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"Yeah We alll shine on, Like the Moon, and the Stars, And the SUN. - John\n                    Lennon\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e curl 127.0.0.1:10000/quote\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Quote\":\"The only true wisdom is in knowing you know nothing. - Socrates\",\"Version\":\"1.0.0\"}\n\nPS C:\\Users\\mvenk\u003e \n\n```\n\n## Changing the Port Number:\n\nWe can change the Port number where API server is running by setting the `PORT` environment variable.\n\nBy default server runs on `10000` Port.\n\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go\n2022/05/07 20:02:39 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/07 20:02:44 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:02:44 Life is like riding a bicycle. To keep your balance, you must keep moving. - Albert Einstein\nexit status 0xc000013a\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \n```\n\nSet the `PORT` Environment variable and run the `go run` \n\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e $env:PORT=\"32000\"\n\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go \n2022/05/07 20:03:33 Simple API Server(1.0.0) running on 0.0.0.0:32000\n2022/05/07 20:03:44 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:03:44 Life is like riding a bicycle. To keep your balance, you must keep moving. - Albert Einstein\n2022/05/07 20:03:52 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:03:52 If my mind can conceive it, if my heart can believe it, then I can achieve it. - Muhammad Ali\nexit status 0xc000013a\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \n```\n\nWe can see the `PORT` is changed.\n\n\u003e I am using the Windows powershell, So I have used `$env:PORT=32000` to set the environment variable. If you are in Linux set using the `export` command.\n\n## Health-check Delayed response:\n\nWe can delay the `/health-check` endpoint response by setting the  **`HEALTHDELAY`** Environment variable.\n\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go    \n2022/05/11 00:41:26 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/11 00:43:29 Entering /health-check endpoint, Invoked from 127.0.0.1:54043\nexit status 0xc000013a\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \n```\n\nSet the `HEALTHDELAY` env\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e $env:HEALTHDELAY=\"5\"\n```\n\nRe-run the app\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go    \n2022/05/11 00:43:43 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/11 00:43:48 Entering /health-check endpoint, Invoked from 127.0.0.1:54049\n2022/05/11 00:43:53 Added 5 seconds delay, Serving Requst Now\nexit status 0xc000013a\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \n```\n\n\u003e Note that the response is served after 5 seconds at `00:43:53`\n\n## Passing your own Quotes(`quotes.json`) file:\n\nYou can change the source Quotes fine by setting the `QUOTESFILE` environment variable. Please look at the following example.\n\n```\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go\n2022/05/07 20:20:42 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/07 20:20:52 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:20:52 Life is like riding a bicycle. To keep your balance, you must keep moving. - Albert Einstein\n2022/05/07 20:20:58 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:20:58 Any fool can write code that a computer can understand. Good programmers write code that humans can understand. - Martin Fowler\nexit status 0xc000013a\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e $env:QUOTESFILE=\"./test.json\"  \nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e go run .\\main.go\n2022/05/07 20:21:15 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/07 20:21:17 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:21:17 Believe you can and you're halfway there. - Theodore Roosevelt\n2022/05/07 20:21:24 Entering /quote endpoint, Invoked from 127.0.0.1:56541 , using ./quotes.json as QuotesSource\n2022/05/07 20:21:24 I hated every minute of training, but I said, 'Don't quit. Suffer now and live the rest of your life as a champion. - Muhammad Ali\nexit status 0xc000013a\nPS C:\\Users\\mvenk\\go\\src\\go-rest-api\u003e \n```\n\u003e Here I have added a `test.json` file on the same folder, So I have used relative Path. Please make sure to specify the correct path for file (or use the Absolute path)\n\n\n# Running on Docker:\n\nYou can create the docker container using the `docker run` like below.\n\n```\nPS C:\\Users\\mvenk\u003e docker run -d -p 10000:10000 mvenkatesh431/k8s-test-container\nfb32856d9d4fa2b9d779ecd802f48da12ce8a5a4fcf2afac86585bee4f0d57bc\nPS C:\\Users\\mvenk\u003e\n\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e docker ps\nCONTAINER ID   IMAGE                              COMMAND    CREATED          STATUS          PORTS                      NAMES\nbb11cb7a12fb   mvenkatesh431/k8s-test-container   \"./main\"   22 seconds ago   Up 22 seconds   0.0.0.0:10000-\u003e10000/tcp   festive_edison\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e \n```\nBy default server listens on `10000` Port on `all Interfaces (0.0.0.0)` of node. We have exposed the port `10000` to the host system. So that I can test with `curl` or any other app.\n\n## Changing the runtime behavior on Docker:\n\n### Changing the Port Number:\n\nWe can change the Port number where API server is running by setting the `PORT` environment variable. By default server runs on `10000` Port.\n\nHere is an example to change the default port number using the docker environment variable. Use the `-e` option and pass the desired port number to `PORT` environment variable.\n\n```\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e docker run -d -e PORT='32000' -p 32000:32000 mvenkatesh431/k8s-test-container\nb9dbfdda77dfd365ae6ff71a8117c8d29669e81620af281efdcec227976f142a\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e \n```\n\nYou can check the logs to see where the server is listening.\n```\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e docker logs b9db\n2022/05/16 18:30:35 Simple API Server(1.0.0) running on 0.0.0.0:32000\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e \n```\nHere it is listening on `0.0.0.0:32000` \n\nMake a call to any of the API endpoint or route.\n```\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e curl 127.0.0.1:32000/env \nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"Version\":\"1.0.0\",\"env\":\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin, HOSTNAME=b9dbfdda77df, PORT=32000, HOME=/root, \n                    VERSION=1.0.0\"}\n```\n\n### Health-check Delayed response:\n\nWe can delay the `/health-check` endpoint response by setting the  **`HEALTHDELAY`** Environment variable. The configurable health-check API is useful to test the `Readiness and Liveness Probes of K8s`\n\nHere I am setting the `5 Seconds` delay by passing the `5` to `HEALTHDELAY` env.\n\n```\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e docker run -d -e HEALTHDELAY='5' -p 10000:10000 mvenkatesh431/k8s-test-container\nfb40641992d51228d30db145cb1bed593d48cd676407c38998c63ac2d0024fd1\n\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e docker ps\nCONTAINER ID   IMAGE                             COMMAND    CREATED         STATUS         PORTS                      NAMES\nfb40641992d5   mvenkatesh431/k8s-test-container   \"./main\"   3 seconds ago   Up 2 seconds   0.0.0.0:10000-\u003e10000/tcp   friendly_jepsen\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e \n```\n\nNow try to access the `/health-check` API. and you will get the delayed response ( You are response delayed by 5 seconds).\n\n```\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e curl 127.0.0.1:10000/health-check\nStatusCode        : 200\nStatusDescription : OK\nContent           : {\"healthy\":true}\n```\n\nWe can also verify the delay by looking into the docker container logs. \n\n```\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e docker logs fb40\n2022/05/16 18:39:50 Simple API Server(1.0.0) running on 0.0.0.0:10000\n2022/05/16 18:40:08 Entering /health-check endpoint, Invoked from 172.17.0.1:45816\n2022/05/16 18:40:13 Added 5 seconds delay, Serving Requst Now\nPS C:\\Users\\mvenk\\go\\src\\k8s-test-container\u003e \n```\nWe can see the request was received at ` 18:40:08` and we delayed it by 5 seconds and served the request at ` 18:40:13`.\n\n# Running on Kubernetes:\n\nCreate a pod definition file and specify the container image as `mvenkatesh431/k8s-test-container`. Here is an example.\n\n*simple-pod.yaml*\n```\napiVersion: v1\nkind: Pod\nmetadata: \n  name: myapi\n  labels:\n    type: myapi\nspec:\n  containers:\n    - name: test-api-server\n      image: mvenkatesh431/k8s-test-container\n```\n\nLet's create the pod using the `kubectl create` command, You can also use the `kubectl apply` command,\n\n```\nPS D:\\Venkey\\K8s\u003e kubectl get pods\nNo resources found in default namespace.\nPS D:\\Venkey\\K8s\u003e\nPS D:\\Venkey\\K8s\u003e kubectl create -f .\\simple-pod.yaml\npod/myapp created\nPS D:\\Venkey\\K8s\u003e\n```\n\nlet's check if the pod is created using the kubectl get pods\n```\nPS D:\\Venkey\\K8s\u003e kubectl create -f .\\simple-pod.yaml\npod/myapi created\nPS D:\\Venkey\\K8s\u003e\nPS D:\\Venkey\\K8s\u003e kubectl get pods\nNAME    READY   STATUS    RESTARTS   AGE\nmyapi   1/1     Running   0          37s\nPS D:\\Venkey\\K8s\u003e\n```\n\nNow the pod is created. You can also check the pod logs using the `kubectl log` command like below.\n```\nPS D:\\Venkey\\K8s\u003e kubectl logs myapi\n2022/05/14 10:46:38 Simple API Server(1.0.0) running on 0.0.0.0:10000\nPS D:\\Venkey\\K8s\u003e\n```\n\nGet more details about the pod using the `kubectl describe pod` command.\n```\nPS D:\\Venkey\\K8s\u003e kubectl describe pod myapi\nName:         myapi\nNamespace:    default\nPriority:     0\nNode:         minikube/192.168.49.2\nStart Time:   Sat, 14 May 2022 16:16:24 +0530\nLabels:       type=myapi\nAnnotations:  \u003cnone\u003e\nStatus:       Running\nIP:           172.17.0.3\nIPs:\n  IP:  172.17.0.3\n....\n....\nEvents:\n  Type    Reason     Age   From               Message\n  ----    ------     ----  ----               -------\n  Normal  Scheduled  42s   default-scheduler  Successfully assigned default/myapi to minikube\n  Normal  Pulling    41s   kubelet            Pulling image \"mvenkatesh431/k8s-test-container\"\n  Normal  Pulled     28s   kubelet            Successfully pulled image \"mvenkatesh431/k8s-test-container\" in 12.9612576s\n  Normal  Created    28s   kubelet            Created container test-api-server\n  Normal  Started    28s   kubelet            Started container test-api-server\nPS D:\\Venkey\\K8s\u003e\n```\n\nI am using `minikube` based setup, so I am login into `minikube node` to test the API.\n```\nPS D:\\Venkey\\K8s\u003e minikube ssh\n                         _             _\n            _         _ ( )           ( )\n  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __\n/' _ ` _ `\\| |/' _ `\\| || , \u003c  ( ) ( )| '_`\\  /'__`\\\n| ( ) ( ) || || ( ) || || |\\`\\ | (_) || |_) )(  ___/\n(_) (_) (_)(_)(_) (_)(_)(_) (_)`\\___/'(_,__/'`\\____)\n\n$\n```\n\nCheck all API endpoints.\n\n```\ndocker@minikube:~$ curl 172.17.0.3:10000/info\n{\"Endpoint\":\"/info\",\"Host\":\"172.17.0.3:10000\",\"Method\":\"GET\",\"RemoteIP\":\"172.17.0.1:42070\",\"Version\":\"1.0.0\"}\ndocker@minikube:~$\ndocker@minikube:~$ curl 172.17.0.3:10000/env\n{\"Version\":\"1.0.0\",\"env\":\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin, HOSTNAME=myapi, KUBERNETES_SERVICE_PORT=443, KUBERNETES_SERVICE_PORT_HTTPS=443, KUBERNETES_PORT=tcp://10.96.0.1:443, KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443, KUBERNETES_PORT_443_TCP_PROTO=tcp, KUBERNETES_PORT_443_TCP_PORT=443, KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1, KUBERNETES_SERVICE_HOST=10.96.0.1, HOME=/root, VERSION=1.0.0\"}\ndocker@minikube:~$\ndocker@minikube:~$ curl 172.17.0.3:10000/health-check\n{\"healthy\":true}\ndocker@minikube:~$\ndocker@minikube:~$ curl 172.17.0.3:10000/quote\n{\"Quote\":\"The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart. - Helen Keller\",\"Version\":\"1.0.0\"}\ndocker@minikube:~$\ndocker@minikube:~$ curl 172.17.0.3:10000/quote\n{\"Quote\":\"Programming isn't about what you know; it's about what you can figure out. - Chris Pine\",\"Version\":\"1.0.0\"}\ndocker@minikube:~$\ndocker@minikube:~$ curl 172.17.0.3:10000/quote\n{\"Quote\":\"The only way to learn a new programming language is by writing programs in it. - Dennis Ritchie\",\"Version\":\"1.0.0\"}\ndocker@minikube:~$\ndocker@minikube:~$\n```\n\n### LICENSE:\nGPL-2.0 license","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvenkatesh431%2Fgo-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvenkatesh431%2Fgo-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvenkatesh431%2Fgo-rest-api/lists"}