Module

HTTPurple.Server

Package
purescript-httpurple
Repository
sigma-andex/purescript-httpurple

#ListenOptionsR Source

type ListenOptionsR :: Row Typetype ListenOptionsR = (backlog :: Maybe Int, certFile :: Maybe String, closingHandler :: Maybe ClosingHandler, hostname :: Maybe String, keyFile :: Maybe String, notFoundHandler :: Maybe (Request Unit -> ResponseM), onStarted :: Maybe (Effect Unit), port :: Maybe Int)

#BasicRoutingSettings Source

type BasicRoutingSettings route = Record (RoutingSettingsR route () ())

#ExtRoutingSettings Source

type ExtRoutingSettings :: Type -> Row Type -> Row Type -> Typetype ExtRoutingSettings route input output = Record (RoutingSettingsR route output) + (MiddlewareSettingsR input output)

#MiddlewareSettingsR Source

type MiddlewareSettingsR :: Row Type -> Row Type -> Row Typetype MiddlewareSettingsR input output = (nodeMiddleware :: NodeMiddlewareStack input output)

#RoutingSettingsR Source

type RoutingSettingsR :: Type -> Row Type -> Row Type -> Row Typetype RoutingSettingsR route output r = (route :: RouteDuplex' route, router :: ExtRequest route output -> ResponseM | r)

#ServerM Source

type ServerM = Effect (Effect Unit -> Effect Unit)

The ServerM is just an Effect containing a callback to close the server. This type is the return type of the HTTPurple serve and related methods.

#defaultMiddlewareErrorHandler Source

#serve Source

serve :: forall route from fromRL via missing missingList. RowToList missing missingList => FillableFields missingList () missing => Union via missing (ListenOptionsR) => RowToList from fromRL => JustifiableFields fromRL from () via => Record from -> BasicRoutingSettings route -> ServerM

#serveNodeMiddleware Source

serveNodeMiddleware :: forall route from fromRL via missing missingList input output outputRL thru. RowToList missing missingList => FillableFields missingList () missing => Union via missing (ListenOptionsR) => RowToList from fromRL => JustifiableFields fromRL from () via => Union output thru output => RowToList output outputRL => KeysRL outputRL => Nub (RequestR route output) (RequestR route output) => Record from -> ExtRoutingSettings route input output -> ServerM