diff --git a/README.md b/README.md index af87653..227359a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![written in go](https://github.com/intergrav/devins-badges/blob/v3/assets/cozy/built-with/go_64h.png?raw=true) -trafficlunar's API +trafficlunar's api ## features diff --git a/internal/server/router.go b/internal/server/router.go index c39d177..cae3e62 100644 --- a/internal/server/router.go +++ b/internal/server/router.go @@ -1,6 +1,7 @@ package server import ( + "encoding/json" "log/slog" "net/http" "os" @@ -43,7 +44,11 @@ func NewRouter() { })) r.Get("/", func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "https://trafficlunar.net", http.StatusPermanentRedirect) + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(map[string]string{ + "name": "trafficlunar's api", + "url": "https://github.com/trafficlunar/api", + }) }) r.Get("/hit", handler.HandleGetHitCounter)