From 4b05aa7bf37d128dc7cb0ef44af2b84ec489b6c6 Mon Sep 17 00:00:00 2001 From: Cody Couperus Date: Thu, 12 Feb 2026 23:56:54 -0800 Subject: [PATCH] add a new test endpoint testing deploy pipeline --- main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main.go b/main.go index ad33b32..228485c 100644 --- a/main.go +++ b/main.go @@ -40,6 +40,10 @@ type HealthResponse struct { Status string `json:"status"` } +type TestResponse struct { + Status string `json:"status"` +} + func getEnv(key string) string { val := os.Getenv(key) if val == "" { @@ -260,6 +264,19 @@ func main() { json.NewEncoder(w).Encode(okStatus) }) + // GET /test + http.HandleFunc("/test", func(w http.ResponseWriter, r *http.Request) { + // testing deployment pipeline + if r.Method != http.MethodGet { + http.Error(w, "method not allowed", http.StatusMethodNotAllowed) + return + } + okStatus := TestResponse{Status: "hello from go"} + + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(okStatus) + }) + // GET /weather/history?city=London&limit=10 http.HandleFunc("/weather/history", func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet {