This repository has been archived on 2022-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
gosocial/pkg/controller/admin/dashboard.go

19 lines
419 B
Go
Raw Normal View History

package admin
import (
"net/http"
"git.kirsle.net/apps/gosocial/pkg/templates"
)
// Admin dashboard or landing page (/admin).
func Dashboard() http.HandlerFunc {
tmpl := templates.Must("admin/dashboard.html")
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if err := tmpl.Execute(w, r, nil); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
})
}