sharded-gotify/error/notfound.go

20 lines
427 B
Go

package error
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/gotify/server/model"
)
// NotFound creates a gin middleware for handling page not found.
func NotFound() gin.HandlerFunc {
return func(c *gin.Context) {
c.JSON(http.StatusNotFound, &model.Error{
Error: http.StatusText(http.StatusNotFound),
ErrorCode: http.StatusNotFound,
ErrorDescription: "page not found",
})
}
}