tfstated/pkg/webui/index.go

17 lines
324 B
Go
Raw Normal View History

package webui
import (
2025-01-22 00:46:49 +01:00
"fmt"
"net/http"
)
func handleIndexGET() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2025-01-22 00:46:49 +01:00
if r.URL.Path == "/" {
http.Redirect(w, r, "/states", http.StatusFound)
} else {
errorResponse(w, http.StatusNotFound, fmt.Errorf("Page not found"))
}
})
}