+{-# LANGUAGE
+ UnicodeSyntax
+ #-}
+import qualified Data.Collections as C
+import Data.Default
+import Network
import Network.HTTP.Lucu
+import Prelude.Unicode
import SmallFile
-main :: IO ()
-main = let config = defaultConfig { cnfServerPort = "9999" }
- resources = mkResTree [ ([], smallFile) ]
+main ∷ IO ()
+main = let config = def { cnfServerPort = "9999" }
+ tree ∷ ResourceTree
+ tree = C.fromList [ ([], nonGreedy smallFile) ]
in
do putStrLn "Access http://localhost:9999/ with your browser."
- runHttpd config resources []
-
\ No newline at end of file
+ withSocketsDo ∘ runHttpd config $ resourceMap tree