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

Michael Snoyman michael at snoyman.com
Tue Jul 19 18:40:10 CEST 2011


That's a bug ;). We need to have /test/static redirect to
/test/static/. I doubt we're going to get this fixed for 0.8, but 0.9
should be coming out very soon with a working version. *However*, it's
not a recommended practice to have directory listings in web apps, and
we'll be disabling it by default in the next release.

On Tue, Jul 19, 2011 at 3:59 PM, Piyush P Kurur <ppk at cse.iitk.ac.in> wrote:
> Dear Yesoder's
>
> I am having a slight problem with the static file serving part of yesod. If I used the following
> routes
>
>
> -- 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.
>
> Regards
>
> ppk
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>



More information about the web-devel mailing list