{-# LANGUAGE RankNTypes #-}
module Web.Spock.Internal.Config where
import qualified Web.Spock.Internal.Wire as W
import Data.Word
import Network.HTTP.Types.Status
import System.IO
import Web.Spock.Internal.CoreAction
import qualified Data.Text as T
import qualified Data.Text.IO as T
data SpockConfig
= SpockConfig
{ sc_maxRequestSize :: Maybe Word64
, sc_errorHandler :: Status -> W.ActionCtxT () IO ()
, sc_logError :: T.Text -> IO ()
}
defaultSpockConfig :: SpockConfig
defaultSpockConfig = SpockConfig Nothing defaultHandler (T.hPutStrLn stderr)
where
defaultHandler = bytes . statusMessage