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

import (
	"fmt"
	"net/http"
)

type Page struct {
	Section string
	Title   string
}

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"))
		}
	})
}