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

import (
	"fmt"
	"net/http"
)

type Page struct {
	Precedent string
	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"))
		}
	})
}