Fan

 

const class

webapp::FindResourceStep

sys::Obj
  web::WebStep
    webapp::WebAppStep
      webapp::FindResourceStep

FindResourceStep is responsible for mapping the incoming the URI to a Fan object and setting the web::WebReq.resource field.

See docLib::WebApp

Slots

checkDirSlashSource

virtual Void checkDirSlash(WebReq req, WebRes res)

If a directory is being accessed without a trailing slash, then redirect to the normalized uri. A directory is defined as any object with a "isDir" method which returns true.

dirIndexSource

const Uri[]? dirIndex := [`index.html`,`index.fan`]

List of file names to search for to map a File directory to a resource.

extSearchSource

const Str[]? extSearch := ["fan","html"]

List extensions to search when resolving the web Uri to the namespace Uri.

findSource

virtual Obj? find(Uri uri)

Attempt to find the resource identified by the specified uri or return null if not found.

findDirIndexSource

virtual Obj findDirIndex(File dir)

Given a directory file, map to a resource which serves as its "index". The standard implementation searches the filenames configured in dirIndex.

findExtSearchSource

virtual Obj? findExtSearch(Uri uri)

Search the configured list of extensions in extSearch to map the web uri to a resource in the local VM's namespace.

homePageSource

const Uri homePage := `/homePage`

Uri of home page resource to for requests to "/".

makeSource

new make(|FindResourceStep|? f := null)

Constructor with it-block.

serviceSource

override Void service(WebReq req, WebRes res)

Perform this step against the specified request and response.