From 0a5e49a5a1acc835ad4fca709d9255fe4e98bfbe Mon Sep 17 00:00:00 2001 From: damir Date: Sat, 4 Apr 2026 13:07:37 +0000 Subject: [PATCH] Add main.go --- main.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..593ba19 --- /dev/null +++ b/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "net/http" + "time" +) + +func main() { + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello from Dockerized Go App!") + }) + + http.HandleFunc("/time", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Current time: %s", time.Now().Format(time.RFC1123)) + }) + + fmt.Println("Server starting on :8080...") + http.ListenAndServe(":8080", nil) +} \ No newline at end of file