20 lines
398 B
Go
20 lines
398 B
Go
package middleware
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.ekzyis.com/ekzyis/delphi.market/server/router/context"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func LNDGuard(sc context.Context) echo.MiddlewareFunc {
|
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
|
return func(c echo.Context) error {
|
|
if sc.Lnd != nil {
|
|
return next(c)
|
|
}
|
|
return echo.NewHTTPError(http.StatusMethodNotAllowed)
|
|
}
|
|
}
|
|
}
|