Module
Nodetrout
- Package
- purescript-nodetrout
- Repository
- nsaunders/purescript-nodetrout
This module exports Nodetrout's public API.
#serve Source
serve :: forall content m handlers layout. Monad m => MonadEffect m => ResponseWritable content => Router layout (Record handlers) m (Tuple MediaType content) => Proxy layout -> Record handlers -> (m ~> Aff) -> (Error -> Effect Unit) -> Request -> Response -> Effect Unit
Creates a node-http
-compatible request handler of type
Request -> Response -> Effect Unit
which executes the specified routing
logic.
#serve' Source
serve' :: forall content handlers layout. ResponseWritable content => Router layout (Record handlers) Aff (Tuple MediaType content) => Proxy layout -> Record handlers -> (Error -> Effect Unit) -> Request -> Response -> Effect Unit
A version of serve
that can be used where handlers run in
ExceptT HTTPError Aff
, i.e. the inner monad is already Aff
.