Spock-api-server
Safe HaskellNone
LanguageHaskell2010

Web.Spock.Api.Server

Synopsis

Documentation

defEndpoint :: forall (p :: [Type]) (i :: Maybe Type) o (m :: Type -> Type) ctx. (MonadIO m, HasRep p) => Endpoint p i o -> HVectElim p (HVectElim (MaybeToList i) (ActionCtxT ctx m o)) -> SpockCtxT ctx m () Source #

Wire an Endpoint defined using the Spock-api package

defDocumentedEndpoint :: forall (p :: [Type]) (q :: [Type]) (i :: Maybe Type) o (m :: Type -> Type) ctx. (MonadIO m, HasRep p) => DocumentedEndpoint p q i o -> HVectElim p (HVectElim q (HVectElim (MaybeToList i) (ActionCtxT ctx m o))) -> SpockCtxT ctx m () Source #

Register a documented endpoint. Arguments are path captures, query/header parameters in declaration order, then the JSON body (if any). Scalar duplicates, missing required parameters, and malformed values return 400. Like defEndpoint, this uses Spock-core routing; configure browser CSRF protection explicitly if using cookie authentication.