#1323 Mistake in FileMod docs

rfeldman Mon 22 Nov 2010

Just noticed the FileMod docs say:

RouteMod
{
  routes =
  [
    "favicon.ico": `pub/icon.png`,
    "stuff":       `pub/`
  ]
}

Since routes is of type Str:WebMod, actually running this code leads to:

java.lang.ClassCastException: fan.sys.Uri cannot be cast to fan.web.WebMod

I believe the most concise way to do this correctly is:

RouteMod
{
  routes =
  [
    "favicon.ico": FileMod { file = `pub/icon.png`.toFile },
    "stuff":       FileMod { file = `pub/`.toFile }
  ]
}

andy Wed 24 Nov 2010

Yep thanks @rfeldman - pushed a fix, and updated online docs too.

Login or Signup to reply.