Module

Node.Restify.Router

Package
purescript-restify-router
Repository
freqlabs/purescript-restify-router

#RouterM Source

data RouterM e a

Monad responsible for router related operations (initial setup mostly).

Constructors

Instances

#Router Source

type Router e = RouterM (restify :: RESTIFY | e) Unit

#useRouter Source

useRouter :: forall opts e. MethodOpts opts => opts -> Router e -> Server e

Apply routes to a server.

#useRouter' Source

useRouter' :: forall e. Router e -> Server e

#apply Source

apply :: forall e. Router e -> Router -> RestifyM e Unit

Apply Router actions to a Restify router.

#http Source

http :: forall opts e. MethodOpts opts => Method -> opts -> Handler e -> Router e

Bind specified handler to handle request matching route and method.

#get Source

get :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http GET

#head Source

head :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http HEAD

#post Source

post :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http POST

#put Source

put :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http PUT

#patch Source

patch :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http PATCH

#del Source

del :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http DEL

#opts Source

opts :: forall opts e. MethodOpts opts => opts -> Handler e -> Router e

Shortcut for http OPTS