Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module quickship_api

go 1.25.4
go 1.25.0

require github.com/gorilla/mux v1.8.1
14 changes: 14 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,22 @@ func main() {
// Use CORS middleware
r.Use(enableCORS)



// Define the route with a variable SKU path.
r.HandleFunc("/cart/summary/{sku}", GetCartSummary).Methods("GET")

// --- ADD THIS HANDLER FOR THE ROOT PATH ("/") ---
r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(map[string]string{
"status": "ok",
"service": "QuickShip API Gateway is running",
"usage": "Use /cart/summary/{sku} to fetch data",
"health": "/health",
})
}).Methods("GET")

// Add a simple route for testing connectivity
r.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
Expand Down