Module

Router

Package
purescript-generic-router
Repository
njaremko/purescript-generic-router

#Context Source

type Context :: Row Type -> Typetype Context r = { params :: Map String String, path :: String | r }

#Router Source

newtype Router :: Row Type -> Type -> Type -> Typenewtype Router context request response

#Route Source

newtype Route

Instances

#makeRouter Source

makeRouter :: forall context request response. { fallbackResponse :: response, requestToContext :: request -> Record context, requestToMethod :: request -> Method, requestToPath :: request -> String, routes :: Map Route (request -> Context context -> response) } -> Router context request response

#makeRoute Source

makeRoute :: { methods :: Array Method, path :: String } -> Route

#route Source

route :: forall context request response. Router context request response -> request -> response