Module

Yoga.Bun.HTTP.Yoga.Om.OmLayer

Package
purescript-yoga-bun-yoga-om
Repository
rowtype-yoga/purescript-yoga-bun-yoga-om

#HTTPServerConfig Source

type HTTPServerConfig = { fetch :: Request -> Aff Response, host :: String, port :: Int }

HTTP server configuration

#HTTPServerL Source

type HTTPServerL :: Row Type -> Row Typetype HTTPServerL r = (httpServer :: BunServer | r)

Row type for HTTP server service

#httpServerLayer Source

httpServerLayer :: forall r. OmLayer (httpServerConfig :: HTTPServerConfig | r) (HTTPServerL ()) ()

Create an HTTP server layer that provides BunServer as a service Requires HTTPServerConfig in context

#httpServerLayer' Source

httpServerLayer' :: forall r. { fetch :: Request -> Aff Response, host :: String, port :: Int } -> OmLayer r (HTTPServerL ()) ()

Create an HTTP server layer with inline config Useful when you don't need config from context