A plug for removing slash at the end of a request path and sending a 301
If available in Hex, the package can be installed
by adding trailing_slash_plug
to your list of dependencies in mix.exs
:
def deps do
[
{:trailing_slash_plug, "~> 0.1"}
]
end
pipeline :trailing_slash do
plug(TrailingSlashPlug)
end
scope "/example", as: :example_pages do
pipe_through([:trailing_slash])
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/trailing_slash_plug.