Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.03 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.03 KB

Who am I, Go?

Simple HTTP project written in Go

See other Who am I? options

Run locally

Execute the server

$ go run cmd/server/main.go

Execute the CURL command

$ curl http://localhost:8081 | json_pp

Docker

Build Docker image

$ docker build -t marcopollivier/whoami:go-latest .

or Download the Docker Image

Push Docker Image

$ docker push marcopollivier/whoami:go-latest

Run Docker container

$ docker run --name whoami_go -d -p 8081:8081 marcopollivier/whoami:go-latest

API REST

Response

  • me: hostname (container ID for example)
  • timestamp: execution start time
{
  "me": "RJ-MB2680.lan",
  "timestamp": "2019-02-12T10:00:00.000Z"
}