Skip to content

martide/trailing_slash_plug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrailingSlashPlug

A plug for removing slash at the end of a request path and sending a 301

Installation

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.0"}
  ]
end

Usage

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.