-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A lightweight server for the Gemini protocol
--
-- This package contains a server for the Gemini
-- (https://gemini.circumlunar.space/) protocol. For a higher
-- level interface, see the gemini-router package.
@package gemini-server
@version 0.2.0.0
module Network.Gemini.Server
-- | A Gemini client's request
data Request
Request :: URI -> Maybe X509 -> Request
[requestURI] :: Request -> URI
[requestCert] :: Request -> Maybe X509
-- | A Gemini server's response
data Response
Response :: Int -> String -> ByteString -> Response
[responseStatus] :: Response -> Int
[responseMeta] :: Response -> String
[responseBody] :: Response -> ByteString
-- | A request handler specifies how the server should respond to the
-- clients' requests
type Handler = Request -> IO Response
-- | Start a Gemini server.
runServer :: Maybe HostName -> ServiceName -> FilePath -> (Request -> IO Response) -> IO ()
-- | Shorthand for Response 20 "text/gemini"
okGemini :: ByteString -> Response
-- | Shorthand for Response 20 "text/plain"
okPlain :: ByteString -> Response
-- | Shorthand for Response 30 uri
redirect :: URI -> Response