Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.2 KB

README.md

File metadata and controls

59 lines (39 loc) · 1.2 KB

whoami

Actually, I did this project to make something in Go and Docker.

I'm very new to GoLang. There are many mistakes and no tests.

Deployment

docker run -d -p 5000:5000 tatoglu/whoami:latest

Endpoints

There are 3 endpoints.

Regular Usage

It can be used to learn hostname of the container.

curl http://localhost:5000/
{"hostname": "89f02ed1a4dd"}

Date

It can be used to learn current date and time of the container.

curl http://localhost:5000/date
{"hostname": "89f02ed1a4dd", "date": "2022-09-17T14:02:52.397349799Z"}

Fun Part

It can use to have fun. The endpoint get a joke from I can haz dad joke website. Everytime a new joke will get.

curl http://localhost:5000/joke
{"hostname": "89f02ed1a4dd", "joke":"People saying 'boo! to their friends has risen by 85% in the last year.... That's a frightening statistic."}

Objectives

  • Develop an API.
  • Call a 3rd party website from the API.
  • Move all the response models into a folder or module.
  • Move all the handlers into a folder or module.
  • Add GitHub Actions for deployment to Docker Hub.