]> gitweb @ CieloNegro.org - Lucu.git/blob - Network/HTTP/Lucu/Config.hs
staticFile
[Lucu.git] / Network / HTTP / Lucu / Config.hs
1 module Network.HTTP.Lucu.Config
2     ( Config(..)
3     , defaultConfig -- Config
4     )
5     where
6
7 import qualified Data.Map as M
8 import           Data.Map (Map)
9 import           Network
10 import           Network.BSD
11 import           Network.HTTP.Lucu.MIMEType
12 import           Network.HTTP.Lucu.MIMEType.DefaultExtensionMap
13 import           System.IO.Unsafe
14
15
16 data Config = Config {
17       cnfServerSoftware       :: String
18     , cnfServerHost           :: HostName
19     , cnfServerPort           :: PortID
20     , cnfMaxPipelineDepth     :: Int
21     , cnfMaxEntityLength      :: Int
22     , cnfMaxURILength         :: Int
23     , cnfMaxOutputChunkLength :: Int
24     , cnfExtToMIMEType        :: Map String MIMEType
25     }
26
27
28 defaultConfig = Config {
29                   cnfServerSoftware       = "Lucu/1.0"
30                 , cnfServerHost           = unsafePerformIO getHostName
31                 , cnfServerPort           = Service "http"
32                 , cnfMaxPipelineDepth     = 100
33                 , cnfMaxEntityLength      = 16 * 1024 * 1024 -- 16 MiB
34                 , cnfMaxURILength         = 4 * 1024         -- 4 KiB
35                 , cnfMaxOutputChunkLength = 5 * 1024 * 1024  -- 5 MiB
36                 , cnfExtToMIMEType        = defaultExtensionMap
37                 }