plug_static_index_html v0.1.1 Plug.Static.IndexHtml
Serves index.html
pages for requests to paths without a filename in Plug applications.
Summary
Functions
Invokes the plug, adding default_file to request_path and path_info for directory paths
Initialize plug options
Functions
Invokes the plug, adding default_file to request_path and path_info for directory paths
Example
iex> opts = Plug.Static.IndexHtml.init(at: "/doc")
iex> conn = %Plug.Conn{request_path: "/doc/a/", path_info: ["doc", "a"]}
iex> Plug.Static.IndexHtml.call(conn, opts) |> Map.take([:request_path, :path_info])
%{path_info: ["doc", "a", "index.html"], request_path: "/doc/a/index.html"}