mirror of
https://github.com/flavioribeiro/donut.git
synced 2025-09-28 11:52:07 +08:00
21 lines
326 B
Go
21 lines
326 B
Go
package handlers
|
|
|
|
import (
|
|
_ "embed"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed index.html
|
|
var indexHTML string
|
|
|
|
type IndexHandler struct{}
|
|
|
|
func NewIndexHandler() *IndexHandler {
|
|
return &IndexHandler{}
|
|
}
|
|
|
|
func (h *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusOK)
|
|
w.Write([]byte(indexHTML))
|
|
}
|