Module

Payload.Server

Package
purescript-payload
Repository
hoodunit/purescript-payload

#launch Source

launch :: forall handlers routesSpec. Routable routesSpec (Record ()) handlers (Record ()) => Spec routesSpec -> handlers -> Effect Unit

Start server with default options, ignoring unexpected startup errors.

#start Source

start :: forall handlers routesSpec. Routable routesSpec (Record ()) handlers (Record ()) => Options -> Spec routesSpec -> handlers -> Aff (Either String Server)

Start server with given routes and handlers (no guards).

#start_ Source

start_ :: forall handlers routesSpec. Routable routesSpec (Record ()) handlers (Record ()) => Spec routesSpec -> handlers -> Aff (Either String Server)

Start server with default options and given route spec and handlers (no guards).

#startGuarded Source

startGuarded :: forall guards handlers guardsSpec routesSpec. Routable routesSpec guardsSpec handlers guards => Options -> Spec { guards :: guardsSpec, routes :: routesSpec } -> { guards :: guards, handlers :: handlers } -> Aff (Either String Server)

Start server with given spec, handlers, and guards.

#startGuarded_ Source

startGuarded_ :: forall guards handlers guardsSpec routesSpec. Routable routesSpec guardsSpec handlers guards => Spec { guards :: guardsSpec, routes :: routesSpec } -> { guards :: guards, handlers :: handlers } -> Aff (Either String Server)

Start server with default options and given spec, handlers, and guards.

#Options Source

type Options = { backlog :: Maybe Int, hostname :: String, logLevel :: LogLevel, port :: Int }

#Server Source

newtype Server

#close Source

close :: Server -> Aff Unit

Stops a server