class Rack::Directory

Rack::Directory serves entries below the root given, according to the path info of the Rack request. If a directory is found, the file’s contents will be presented in an html based index. If a file is found, the env will be passed to the specified app.

If app is not specified, a Rack::Files of the same root will be used.

Be aware that just like the default behavior of most webservers, Rack::Directory will follow symbolic links encountered under the root. If a symlink points to a location outside of the root, that target will still be served as part of the response.