]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/ImplantedSmall.hs
hlint
[Lucu.git] / examples / ImplantedSmall.hs
index 9ee3466e1217c39fb4bbda99fa611137310a5452..fe45b89615dcfbeafd9284f965577df76dc51749 100644 (file)
@@ -1,11 +1,16 @@
+{-# LANGUAGE
+    UnicodeSyntax
+  #-}
+import qualified Data.Collections as C
 import Network
 import Network.HTTP.Lucu
+import Prelude.Unicode
 import SmallFile
 
-main :: IO ()
-main = let config    = defaultConfig { cnfServerPort = PortNumber 9999 }
-           resources = mkResTree [ ([], smallFile) ]
+main ∷ IO ()
+main = let config = defaultConfig { 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