From my understanding plugs within a router are executed sequentially one by one and plugs like the CSRF plug allow options to be defined within the route to skip the CSRF check. How would I go about defining a different plug pipeline for a group of routes. The best I've been able to figure out is to define a separate router and have the main router forward matching requests to it. The (minor) issue I have with this is that if forces me to have a prefix for those routes which I can live with but would like to know if there is another way to do it.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/d86d8223-bb3b-4cc0-8f6c-8f983dc1d01f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
defmodule MyPipeline douse Plug.Builderplug :fooplug :barplug :baz
plug :dispatch
def dispatch(conn, opts) do
opts[:route].(conn)
end
end
get "/foo/bar" do
MyPipeline.call(conn, route: fn conn ->
# Your route code
end)
end
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/6bcab9d1-e72c-4ca6-a515-d1b75a944ba1%40googlegroups.com.