mirror of
https://github.com/portainer/portainer.git
synced 2025-07-18 21:09:40 +02:00
* refactor(api): refactor base import path * fix(build-system): update build_binary_devops * fix(build-system): fix build_binary_devops for linux * fix(build-system): fix build_binary_devops for Windows
24 lines
474 B
Go
24 lines
474 B
Go
package motd
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gorilla/mux"
|
|
"github.com/portainer/portainer/api/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
|
|
}
|