Sign inSign up

krezz/whoami

By krezz

•Updated almost 6 years ago

Image
0

1.8K

krezz/whoami repository overview

⁠Whoami Json web server

⁠Routes

/ - Get whoami server info

Request:

curl -Ss http://localhost | jq

Response:

{
  "hostname": "my-laptop",
  "ip": [
    "172.17.0.1",
  ],
  "host": "localhost",
  "url": "/api/v1/status",
  "headers": {
    "Accept": [
      "*/*"
    ],
    "User-Agent": [
      "curl/7.59.0"
    ]
  },
  "remote_addr": "172.17.0.1:52550",
  "user_agent": "curl/7.59.0",
  "content_type": "application/json"
}
/ping - Check server by ping

Request:

curl -Ss http://localhost/ping | jq

Response:

{
  "ping": "pong"
}
/metrics - Get server metrics in Prometheus format

Request:

curl -Ss http://localhost/metrics

Response:

promhttp_metric_handler_requests_total{code="200"} 0
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0

⁠Usage

To start docker image run:

docker run --rm -p 80:80 krezz/whoami

⁠Environment variables

Environment variableDefault valueRequiredDescription
WEB_SERVER_HOST0.0.0.0falseWeb server listen host
WEB_SERVER_PORT80falseWeb server listen port

Tag summary

Content type

Image

Digest

Size

9.3 MB

Last updated

almost 6 years ago

docker pull krezz/whoami