import Network.HTTP.Lucu.Resource.Tree
import Network.HTTP.Lucu.ResponseWriter
import Network.HTTP.Lucu.SocketLike as SL
+import Prelude.Unicode
-- |This is the entry point of Lucu httpd. It listens to a socket and
-- waits for clients. 'runHttpd' never stops by itself so the only way
-- > in
-- > runHttpd config resourcees []
-- >
--- > helloWorld :: ResourceDef
+-- > helloWorld :: Resource
-- > helloWorld = emptyResource {
-- > resGet
-- > = Just $ do setContentType [mimeType| text/plain |]
launchListener so
= do p ← SL.socketPort so
-- FIXME: Don't throw away the thread ID as we can't
- -- kill it later then. [1]
- void $ forkIO $ httpLoop p so
+ -- kill it later then.
+ void ∘ forkIO $ httpLoop p so
listenOn ∷ Family → HostName → ServiceName → IO Socket
listenOn fam host srv