2025-01-06 00:41:32 +01:00
|
|
|
package webui
|
|
|
|
|
|
|
|
import (
|
2025-01-22 00:46:49 +01:00
|
|
|
"fmt"
|
2025-01-06 00:41:32 +01:00
|
|
|
"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"))
|
|
|
|
}
|
2025-01-06 00:41:32 +01:00
|
|
|
})
|
|
|
|
}
|