[web-devel] yesod: problem with static directory listing

Piyush P Kurur ppk at cse.iitk.ac.in
Tue Jul 19 14:59:29 CEST 2011

Dear Yesoder's

I am having a slight problem with the static file serving part of yesod. If I used the following

-- Site.hs

data Site = Site { getStatic :: Static }
mkYesodData "Site" [$parseRoutes|
   /test        RootR   GET
   /test/static StaticR Static getStatic

and use the following static configurations

-- Controller.hs

withTest :: (Application -> IO a) -> IO a
withTest f = toWaiApp site >>= f
               where site = Site {getStatic = static "static"}

I get the following problem

(1) Files are properly served from the static directory However

(2) If I access the url http://localhost:3000/test/static 

The directory listing shows

	root with url http://localhost:3000/test
	index.html with url http://localhost:3000/test/index.html

You can get the complete code by

$ darcs get http://www.cse.iitk.ac.in/users/ppk/yesod/static

Any help is appreciated.



More information about the web-devel mailing list