mirror of https://github.com/portainer/portainer
25 lines
470 B
Go
25 lines
470 B
Go
package motd
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gorilla/mux"
|
|
"github.com/portainer/portainer/http/security"
|
|
)
|
|
|
|
// Handler is the HTTP handler used to handle MOTD operations.
|
|
type Handler struct {
|
|
*mux.Router
|
|
}
|
|
|
|
// NewHandler returns a new Handler
|
|
func NewHandler(bouncer *security.RequestBouncer) *Handler {
|
|
h := &Handler{
|
|
Router: mux.NewRouter(),
|
|
}
|
|
h.Handle("/motd",
|
|
bouncer.AuthenticatedAccess(http.HandlerFunc(h.motd))).Methods(http.MethodGet)
|
|
|
|
return h
|
|
}
|