elixir-plug / plug

Compose web applications with functions
https://hex.pm/packages/plug
Other
2.88k stars 586 forks source link

Support of format extensions #1008

Closed astalker closed 3 years ago

astalker commented 3 years ago

We have a similar issue to one from a few years ago https://github.com/elixir-plug/plug/issues/475 where we would like to be able to support a large number of legacy routes. The routes in question have the format of /my_route.app.

We have looked into using the trailing format plug however due to the DSL that we provide it makes it much more difficult for us to use it to proper effect. We have currently gone with a route rewrite approach that avoids the InvalidSpecError and also allows us to support both /my_route and /my_route.app as distinct paths.

Would there be any interest in supporting this in Plug? It may provide a way for others migrating from the Rails like format.

We have prepared a PR in support of this here https://github.com/elixir-plug/plug/pull/1007

josevalim commented 3 years ago

Closing in favor of PR!