]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/Implanted.hs
docs
[Lucu.git] / examples / Implanted.hs
index 68423086a2472ac51fa1d777ecf9ac412fbe2a97..03bcbdb1a88593972e17e594ca2b6f6c07bd907b 100644 (file)
@@ -1,10 +1,15 @@
+{-# LANGUAGE
+    UnicodeSyntax
+  #-}
+import qualified Data.Collections as C
 import MiseRafturai
+import Network
 import Network.HTTP.Lucu
 
-main :: IO ()
-main = let config    = defaultConfig { cnfServerPort = "9999" }
-           resources = mkResTree [ ([], miseRafturai) ]
+main ∷ IO ()
+main = let config = defaultConfig { cnfServerPort = "9999" }
+           tree   ∷ ResourceTree
+           tree   = C.fromList [ ([], nonGreedy miseRafturai) ]
        in
          do putStrLn "Access http://localhost:9999/ with your browser."
-            runHttpd config resources []
-                                   
\ No newline at end of file
+            withSocketsDo $ runHttpd config $ resourceMap tree