Backend for Common Gateway Interface. Almost all users should use the
run
function.
- run :: Application -> IO ()
- runSendfile :: ByteString -> Application -> IO ()
- runGeneric :: [(String, String)] -> (forall a. Int -> Enumerator ByteString IO a) -> (ByteString -> IO ()) -> Maybe ByteString -> Application -> IO ()
- requestBodyFunc :: (Int -> IO (Maybe ByteString)) -> Int -> Enumerator ByteString IO a
Documentation
run :: Application -> IO ()Source
Run an application using CGI.
:: ByteString | sendfile header |
-> Application | |
-> IO () |
Some web servers provide an optimization for sending files via a sendfile system call via a special header. To use this feature, provide that header name here.
:: [(String, String)] | all variables |
-> (forall a. Int -> Enumerator ByteString IO a) | responseBody of input |
-> (ByteString -> IO ()) | destination for output |
-> Maybe ByteString | does the server support the X-Sendfile header? |
-> Application | |
-> IO () |
A generic CGI helper, which allows other backends (FastCGI and SCGI) to
use the same code as CGI. Most users will not need this function, and can
stick with run
or runSendfile
.
requestBodyFunc :: (Int -> IO (Maybe ByteString)) -> Int -> Enumerator ByteString IO aSource