+
+
+staticDir :: FilePath -> ResourceDef
+staticDir path
+ = ResourceDef {
+ resUsesNativeThread = False
+ , resIsGreedy = True
+ , resGet = Just $ handleStaticDir path
+ , resHead = Nothing
+ , resPost = Nothing
+ , resPut = Nothing
+ , resDelete = Nothing
+ }
+
+
+handleStaticDir :: FilePath -> Resource ()
+handleStaticDir basePath
+ = do extraPath <- getPathInfo
+ let path = basePath ++ "/" ++ joinWith "/" extraPath
+
+ handleStaticFile path