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

import (
	"net/http"
)

type CertHandler struct {
	Cainfo caInfo
}

func (ch *CertHandler) CertResponder(w http.ResponseWriter, r *http.Request) {
	ch.Cainfo.CertWriter(w)
}

func HttpFileHandler(route string, path string) {
	http.HandleFunc(route, func(w http.ResponseWriter, r *http.Request) {
		http.ServeFile(w, r, path)
	})
}