Module

Solid.Start.RequestEvent

Package
purescript-purs-solid
Repository
arazorda/purs-solid

The current server request, available in middleware, server functions and during rendering. On the client there is none.

#RequestEvent Source

#cookies Source

cookies :: RequestEvent -> Object String

URI-decoded.

#CookieOptions Source

type CookieOptions :: Row Typetype CookieOptions = (domain :: String, httpOnly :: Boolean, maxAge :: Int, partitioned :: Boolean, path :: String, sameSite :: SameSite, secure :: Boolean)

#SameSite Source

newtype SameSite

Instances

#setCookie Source

setCookie :: forall given missing. Union given missing CookieOptions => String -> String -> Record given -> RequestEvent -> Effect Unit

Takes any subset of CookieOptions. Unset fields default to path /, HttpOnly, Secure and SameSite=Lax.

#deleteCookie Source

deleteCookie :: forall given missing. Union given missing CookieOptions => String -> Record given -> RequestEvent -> Effect Unit

Expires the cookie. Pass the path and domain it was set with.

#setResponseStatus Source

setResponseStatus :: Int -> RequestEvent -> Effect Unit

For middleware and server functions; while rendering, use Solid.Start.Response.httpStatus.

#LocalKey Source

newtype LocalKey a

A typed slot in the request's locals. Define each key once and share it: two keys with the same name refer to the same slot.

#localKey Source

localKey :: forall a. String -> LocalKey a

#getLocal Source

getLocal :: forall a. LocalKey a -> RequestEvent -> Effect (Maybe a)

#setLocal Source

setLocal :: forall a. LocalKey a -> a -> RequestEvent -> Effect Unit