Skip to content

coderclub-dev/whoamigo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
}