webserver-0.7.1.1: HTTP server library

Safe HaskellNone

Network.Web.Server.Params

Synopsis

Documentation

data BasicConfig Source

The configuration for the basic web server.

Constructors

BasicConfig 

Fields

mapper :: Request -> IO Path

A mapper from URI to Path.

obtain :: FilePath -> Maybe (Integer, Integer) -> IO ByteString

Resource obtaining function. The second argument is (offset of the resource, and length from the offset).

info :: FilePath -> IO (Maybe (Integer, UTCTime))

A function to return the size of the resource and its modification time if exists.

serverName :: ByteString

A server name specified the Server: field.

tcpInfo :: TCPInfo

TCPInfo for passing CGI. (See c10k library.)

defaultConfig :: BasicConfigSource

Default BasicConfig, with obtain, info, and serverName filled in. It is necessary to override the mapper and tcpInfo fields

data Path Source

Control information of how to handle URI.

Constructors

None

URI cannot be converted into any resources.

File FilePath

URI is converted into a resource (typically a file).

PathCGI CGI

URI is converted into CGI.

Handler (IO Response)

URI is converted into a handler callback

Instances

data CGI Source

Internal information of CGI converted from URI.

Constructors

CGI 

Fields

progPath :: FilePath

A program path to be executed.

scriptName :: String

A script name.

pathInfo :: String

A path information.

queryString :: String

A query string.

Instances

defaultInfo :: FilePath -> IO (Maybe (Integer, UTCTime))Source

Get the size and modification time of a file, if possible.

defaultObtain :: FilePath -> Maybe (Integer, Integer) -> IO ByteStringSource

Obtain a data slice from a file as a lazy bytestring.