]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - examples/HelloWorld.hs
staticFile
[Lucu.git] / examples / HelloWorld.hs
index f3a36219fbd69fda04fefef40648dc1d5ca98b63..a2c6d50c02795a8959fb1c54c2b5a32d100ff95e 100644 (file)
@@ -11,13 +11,18 @@ import Network.HTTP.Lucu.Parser.Http
 import Network.HTTP.Lucu.Resource
 import Network.HTTP.Lucu.Resource.Tree
 import Network.HTTP.Lucu.Response
+import Network.HTTP.Lucu.StaticFile
 import Network.URI
 import System.Posix.Signals
 import System.Time
 
 main :: IO ()
 main = let config    = defaultConfig { cnfServerPort = PortNumber 9999 }
-           resources = mkResTree [ ([], helloWorld) ]
+           resources = mkResTree [ ( []
+                                   , helloWorld )
+                                 , ( ["compilers"]
+                                   , staticFile "/etc/compilers" )
+                                 ]
        in
          do installHandler sigPIPE Ignore Nothing
             runHttpd config resources