]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/HelloWorld.hs
Implemented fallback handler.
[Lucu.git] / examples / HelloWorld.hs
index f21e052d7c0a8219ae0ee6b91510e081ee4032e4..00cb33775825fb218c85cb6fcb17e8bf54f9aba6 100644 (file)
@@ -12,9 +12,13 @@ main = let config    = defaultConfig { cnfServerPort = PortNumber 9999 }
                                  , ( ["inc"]
                                    , staticDir "/usr/include" )
                                  ]
+           fallbacks = [ \ path -> case path of
+                                     ["hello"] -> return $ Just helloWorld
+                                     _         -> return Nothing
+                       ]
        in
          do putStrLn "Access http://localhost:9999/ with your browser."
-            runHttpd config resources
+            runHttpd config resources fallbacks
 
 
 helloWorld :: ResourceDef