plug_static_index_html v1.0.0 Plug.Static.IndexHtml View Source
Serves index.html
pages for requests to paths without a filename in Plug applications.
Link to this section Summary
Functions
Invokes the plug, adding default_file to request_path and path_info for directory paths
Initialize plug options
Link to this section 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"}