Behaviour: openflax.handler.
This handler implements the displaying of simple directory listings in a web page.
This handler requires openflax.handler.file
and openflax.handler.template.
This handler supports the following configuration options in
the conf() passed to it:
cfg_ls_index_filefilename().
A filename to be directed to if it exists in the directory.
Typically index.html, but may be changed.
cfg_ls_index_ctypecontent_type().
The MIME content-type of cfg_ls_index_file.
Typically text/html, but may be changed.
cfg_ls_filter[{regexp(), boolean()}].
A list of pairs of regular expressions and boolean values
indicating which files to list and which to not list.
By default, all files are listed, and filters later
in the list override filters earlier in the list.
For example, to only list text files which do not start with
"BACKUP", one might say
[{"*", false}, {"*.txt", true}, {"BACKUP*", false}].
cfg_template_bodytemplate().
The template for the page to be generated to display a directory.
It should display the tpl_ls_body item.
cfg_ls_template_each_filetemplate().
A mini-template for each file to be displayed in the directory
listing. It can display tpl_ls_filename,
tpl_ls_filesize, etc.
cfg_ls_template_each_subdirtemplate().
A mini-template for each subdirectory to be displayed in the directory
listing. It can display tpl_ls_filename,
tpl_ls_filesize, etc.
| serve/1 | Serves a simple listing of a world-readable, world-executable directory to the connected user agent. |
| start/1 | Initializes the directory server. |
| stop/1 | Shuts down the directory server. |
serve(Conf::conf()) -> {response(), conf()}
Serves a simple listing of a world-readable, world-executable directory to the connected user agent.
Initializes the directory server.
Shuts down the directory server.