happstack-helpers-0.52: Convenience functions for Happstack.

Happstack.Helpers.DirBrowse

Description

Directory browsing for HAppS

browsedir "someDirectory"

Synopsis

Documentation

browsedir :: MonadIO m => FilePath -> FilePath -> ServerPartT m ResponseSource

browsedir = browsedir' defPaintdir defPaintfile

define a ServerPartT value with something like

sp = browsedir "projectroot" "."

where projectroot is an alias (what you see in the url) and . is the path relative to the executable running

the happs server

browsedirHS :: MonadIO m => FilePath -> FilePath -> ServerPartT m ResponseSource

like browsedir, but haskell files are rendered through hscolour

browsedirHS = browsedir' defPaintdir hsPaintfile

browsedir' :: (ToMessage a, ToMessage b, MonadIO m) => (String -> [FilePath] -> a) -> (String -> String -> b) -> FilePath -> FilePath -> ServerPartT m ResponseSource

browsedir' paintdir paintfile diralias syspath

paintdir/paintfile are rendering functions

diralias: path that will appear in browser

syspath: real system path