]> Skullheadx's Git Forge - monopoly-web.git/commitdiff
organize main.go
authorSkullheadx <admonty1@protonmail.com>
Sat, 16 May 2026 19:39:52 +0000 (15:39 -0400)
committerSkullheadx <admonty1@protonmail.com>
Sat, 16 May 2026 19:39:52 +0000 (15:39 -0400)
main.go

diff --git a/main.go b/main.go
index 30841e712d9daf8d99d07302ff0b6076f2af1cf9..d35d86ba0bc80b679ee2f9ee47ab2ede296000cb 100644 (file)
--- a/main.go
+++ b/main.go
@@ -9,13 +9,18 @@ import (
 
 );
 
-func main() {
-       fmt.Println("monopoly-web")
 
-       healthHandler:= func(w http.ResponseWriter, req *http.Request) {
-               io.WriteString(w, "Status: healthy\n")
-       }
+func main() {
+       fmt.Println("monopoly-web backend")
 
+       // register routes
        http.HandleFunc("/health", healthHandler)
+
+
+       // listen and serve
        log.Fatal(http.ListenAndServe(":8080",nil))
 }
+
+func healthHandler(w http.ResponseWriter, req *http.Request) {
+               io.WriteString(w, "Status: healthy\n")
+}