library(http/http_dispatch). In the typical usage scenario, one needs to define an http location and a file-search path that is used as the root of the server. E.g., the following declarations create a self-contained web-server for files in
user:file_search_path(pwp, '/web/pwp'). :- http_handler(root(.), pwp_handler([path_alias(pwp)]), [prefix]).
- Search for PWP files as Alias(Path). See absolute_file_name/3.
- Name of the directory index (pwp) file. This option may appear multiple
times. If no such option is provided,
pwp_handler/2 looks for
false), allow for ?view=source to serve PWP file as source.
- If a directory has no index-file, pwp_handler/2 calls Hook(PhysicalDir, Options, Request). If this semidet predicate succeeds, the request is considered handled.
- Hide files of the given extensions. The default is to hide .pl files.
- DTD to parse the input file with. If unbound, the generated DTD is returned
permission_error(index, http_location, Location)is raised if the handler resolves to a directory that has no index.
- See also