wobsurv-0.1.0: A simple and highly performant HTTP file server

Safe HaskellNone
LanguageHaskell2010

Wobsurv

Synopsis

Documentation

data Settings Source

Settings for running the server.

Constructors

Settings 

Fields

logging :: Bool

Whether to log requests in the stdout.

port :: Word

A port to listen on.

connectionsLimit :: Word

A maximum amount of clients. When this amount is reached the server rejects all the further connections with a "Service Unavailable" status.

templatesDir :: FilePath

A path to the directory containing template files for server responses.

contentDir :: FilePath

A directory, the contents of which should be served.

mimeMappings :: HashMap Text ByteString

MIME content-type mappings.

Instances

serve :: Settings -> IO () Source

Run the server with the provided settings.

This operation is blocking. If you need to be able to stop the server run it in a separate thread, killing that thread will stop the server and properly release all the resources acquired by the server.