summaryrefslogtreecommitdiff
path: root/pkg/webui/index.go
blob: 3a52fc195295c2e7ed946b07d60504ef1eca4fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package webui

import (
	"fmt"
	"net/http"
)

func handleIndexGET() http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		if r.URL.Path == "/" {
			http.Redirect(w, r, "/states", http.StatusFound)
		} else {
			errorResponse(w, http.StatusNotFound, fmt.Errorf("Page not found"))
		}
	})
}