package handlers import ( "encoding/json" "net/http" ) type Response struct { Message string `json:"message"` } func HandlersWelcome(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet { http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) return } response := Response{ Message: "Welcome to the API!", } w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(response) }