Portability | |
---|---|
Stability | provisional |
Maintainer | diatchki@galois.com |
Safe Haskell | None |
- server :: HStream a => Handler a -> IO ()
- serverWith :: HStream a => Config -> Handler a -> IO ()
- type Handler a = SockAddr -> URL -> Request a -> IO (Response a)
- data Config = Config {}
- defaultConfig :: Config
- data Request a = Request {
- rqURI :: URI
- rqMethod :: RequestMethod
- rqHeaders :: [Header]
- rqBody :: a
- data Response a = Response {
- rspCode :: ResponseCode
- rspReason :: String
- rspHeaders :: [Header]
- rspBody :: a
- data RequestMethod
- module Network.HTTP.Server.Response
Documentation
server :: HStream a => Handler a -> IO ()Source
Start a server with the default configuration, and the given handler. Requests are handled in separate threads.
serverWith :: HStream a => Config -> Handler a -> IO ()Source
Start a server with the given configuration and handler. Requests are handled in separate threads.
type Handler a = SockAddr -> URL -> Request a -> IO (Response a)Source
Handlers invoked to process requests. The type parameter is for the type of the payload in the body. It is a variation on string of some sort (e.g., String, ByteString, etc.)
Server configuration.
Some default options for a server: no logging output, listen on "localhost:8000".
data Request a
data Response a
data RequestMethod
module Network.HTTP.Server.Response