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 )
+
+ , ( ["index.html"]
+ , staticFile "/Users/admin/Sites/index.html" )
+
+ , ( ["urandom"]
+ , staticFile "/dev/urandom" )
+
+ , ( ["inc"]
+ , staticDir "/usr/include" )
+ ]
in
do installHandler sigPIPE Ignore Nothing
runHttpd config resources
resUsesNativeThread = False
, resIsGreedy = False
, resGet
- = Just $ do time <- liftIO $ getClockTime
- foundEntity (strongETag "abcde") time
+ = Just $ do --time <- liftIO $ getClockTime
+ --foundEntity (strongETag "abcde") time
setContentType $ "text" +/+ "hello"
outputChunk "Hello, "
outputChunk "World!\n"