StaticFiles constructor

StaticFiles(
  1. String baseDir, {
  2. List<String> defaultFilenames = standardFilenames,
  3. bool allowFilePathsAsDirectories = true,
  4. bool allowDirectoryListing = false,
  5. String publicServerUrl = '',
})

Constructor

Requests for a directory (i.e. path ending in "/") returns one of the defaultFilenames in the directory (if it is set and a file exists), otherwise if allowDirectoryListing is true a listing of the directory is produced, otherwise an exception is thrown.

The defaultFilenames default to standardFilenames, if not specified.

Implementation

StaticFiles(String baseDir,
    {this.defaultFilenames = standardFilenames,
    this.allowFilePathsAsDirectories = true,
    this.allowDirectoryListing = false,
    this.publicServerUrl = ''})
    : _baseDir = _checkAndFixBaseDir(baseDir);