http-server-1: A library fro writing Haskell web servers.Source codeContentsIndex
Network.HTTP.Server
Portability
Stabilityprovisional
Maintainerdiatchki@galois.com
Description
Synopsis
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 {
srvLog :: Logger
srvHost :: HostName
srvPort :: PortNumber
}
defaultConfig :: Config
Request (Request, rqURI, rqMethod, rqHeaders, rqBody)
Response (Response, rspCode, rspReason, rspHeaders, rspBody)
RequestMethod (HEAD, PUT, GET, POST, DELETE, OPTIONS, TRACE, CONNECT, Custom)
module Network.HTTP.Headers
module Network.HTTP.Server.Response
Documentation
server :: HStream a => Handler a -> IO ()Source
Start a server with the default configureation, and the given handler. Requests are handled in separete threads.
serverWith :: HStream a => Config -> Handler a -> IO ()Source
Start a server with the given configuration and handler. Requests are handled in separete 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.)
data Config Source
Server configuration.
Constructors
Config
srvLog :: LoggerServer reports what's going on here.
srvHost :: HostNameHost name to bind to.
srvPort :: PortNumberPort to listen on.
defaultConfig :: ConfigSource
Some default options for a server: no logging output, listen on "localhost:8000".
Request (Request, rqURI, rqMethod, rqHeaders, rqBody)
Response (Response, rspCode, rspReason, rspHeaders, rspBody)
RequestMethod (HEAD, PUT, GET, POST, DELETE, OPTIONS, TRACE, CONNECT, Custom)
module Network.HTTP.Headers
module Network.HTTP.Server.Response
Produced by Haddock version 2.4.2