elli-lib / elli_fileserve

Development has moved to elli_static.
https://github.com/elli-lib/elli_static
0 stars 4 forks source link

Serve index.html? files for request paths ending with /, if available. #1

Closed yurrriq closed 7 years ago

yurrriq commented 8 years ago

Serve index.html? files for request paths ending with /, if available.

Currently the default is index.html. It would be nice to ensure default is configurable, too.

yurrriq commented 7 years ago

default can be configured as follows:

FileserveConfig = [{prefix, <<"/prefix">>},
                   {path, <<"/tmp">>},
                   {charset, <<"utf-8">>},
                   {default, <<"file.ext">>}],
Config = [{mods, [{elli_fileserve, FileserveConfig}]}],
elli:start_link([{callback, elli_middleware},
                 {callback_args, Config}]).

Supporting something like {regex, <<"index.html?">>} would involve some moderate refactoring and I don't have an immediate use case. Closing for now.