Node.Express.Request
- Package
- purescript-express
- Repository
- dancingrobot84/purescript-express
#getRouteParam Source
getRouteParam :: forall a e. RequestParam a => a -> HandlerM (express :: EXPRESS | e) (Maybe String)Get route param value. If it is named route, e.g /user/:id then
getRouteParam "id" return matched part of route. If it is
regex route, e.g. /user/(\d+) then getRouteParam 1 return
part that matched (\d+) and getRouteParam 0 return whole
route.
#getBody Source
getBody :: forall a e. Decode a => HandlerM (express :: EXPRESS | e) (Either MultipleErrors a)Get the request's body. NOTE: Not parsed by default, you must attach proper middleware See http://expressjs.com/4x/api.html#req.body
#getBodyParam Source
getBodyParam :: forall a e. Decode a => String -> HandlerM (express :: EXPRESS | e) (Maybe a)Get param from request's body. NOTE: Not parsed by default, you must attach proper middleware See http://expressjs.com/4x/api.html#req.body
#getRemoteIp Source
getRemoteIp :: forall e. HandlerM (express :: EXPRESS | e) StringReturn remote or upstream address.
#getRemoteIps Source
getRemoteIps :: forall e. HandlerM (express :: EXPRESS | e) (Array String)Return list of X-Forwarded-For proxies if any.
#getHostname Source
getHostname :: forall e. HandlerM (express :: EXPRESS | e) StringReturn Host header field.
#getSubdomains Source
getSubdomains :: forall e. HandlerM (express :: EXPRESS | e) (Array String)Return array of subdomains.
#getProtocol Source
getProtocol :: forall e. HandlerM (express :: EXPRESS | e) (Maybe Protocol)Return request protocol.
#getOriginalUrl Source
getOriginalUrl :: forall e. HandlerM (express :: EXPRESS | e) StringReturn request original URL.
#setUserData Source
setUserData :: forall e a. String -> a -> Handler eSets the specified field of the userData object attached to the Request object to specified data