X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=examples%2FHelloWorld.hs;h=a2c6d50c02795a8959fb1c54c2b5a32d100ff95e;hp=f3a36219fbd69fda04fefef40648dc1d5ca98b63;hb=a44a96d95b5fcbaf24a21c0336046ce0c3bab614;hpb=c6b11025d1f81c668e9995e856b7bb34175230d3 diff --git a/examples/HelloWorld.hs b/examples/HelloWorld.hs index f3a3621..a2c6d50 100644 --- a/examples/HelloWorld.hs +++ b/examples/HelloWorld.hs @@ -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