tfstated/pkg/webui/index.go

22 lines
378 B
Go
Raw Normal View History

package webui
import (
2025-01-22 00:46:49 +01:00
"fmt"
"net/http"
)
2025-01-26 00:04:38 +01:00
type Page struct {
Section string
Title string
}
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"))
}
})
}