diff --git a/app/routes.go b/app/routes.go index ccb3190..eae2273 100644 --- a/app/routes.go +++ b/app/routes.go @@ -3,6 +3,7 @@ package app import ( "net/http" + "git.dotya.ml/mirre-mt/pcmt/handlers" "github.com/labstack/echo/v4" ) @@ -15,4 +16,7 @@ func (a *App) SetupRoutes() { e.HEAD("/", func(c echo.Context) error { return c.NoContent(http.StatusOK) }) + + // administrative endpoints. + e.GET("/admin", handlers.Admin()) } diff --git a/handlers/handlers.go b/handlers/handlers.go new file mode 100644 index 0000000..dc92400 --- /dev/null +++ b/handlers/handlers.go @@ -0,0 +1,13 @@ +package handlers + +import ( + "net/http" + + "github.com/labstack/echo/v4" +) + +func Admin() echo.HandlerFunc { + return func(c echo.Context) error { + return echo.NewHTTPError(http.StatusUnauthorized, "Invalid credentials") + } +}