From c7f7f656c2598289e702fc62622784763393bc00 Mon Sep 17 00:00:00 2001 From: rdev-worker Date: Sat, 31 Jan 2026 07:47:53 +0000 Subject: [PATCH] build: Build a simple Go API server with: 1. GET /api/health endpoint 2. GET... --- backend/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/main.go b/backend/main.go index 26b4694..57d6da9 100644 --- a/backend/main.go +++ b/backend/main.go @@ -116,6 +116,16 @@ func main() { // Routes r.Route("/api", func(r chi.Router) { + // Health check + r.Get("/health", func(w http.ResponseWriter, r *http.Request) { + jsonResponse(w, http.StatusOK, APIResponse{Success: true, Data: "OK"}) + }) + + // Hello World + r.Get("/hello", func(w http.ResponseWriter, r *http.Request) { + jsonResponse(w, http.StatusOK, APIResponse{Success: true, Data: "Hello World"}) + }) + r.Get("/tasks", func(w http.ResponseWriter, r *http.Request) { tasks := store.GetAll() jsonResponse(w, http.StatusOK, APIResponse{Success: true, Data: tasks})