Guest User

Untitled

a guest
May 27th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. defmodule MyAppWeb.FooController do
  2. use MyAppWeb, :controller
  3.  
  4. def index01(conn, _params) do
  5. ~~~
  6. end
  7.  
  8. def index02(conn, _params) do
  9. ~~~
  10. end
  11. end
  12.  
  13. defmodule MyAppWeb.BarController do
  14. use MyAppWeb, :controller
  15.  
  16. def index01(conn, _params) do
  17. ~~~
  18. end
  19.  
  20. def index02(conn, _params) do
  21. ~~~
  22. end
  23. end
  24.  
  25. pipeline :browser do
  26. plug :accepts, ["html"]
  27. plug :fetch_session
  28. plug :fetch_flash
  29. plug :protect_from_forgery
  30. plug :put_secure_browser_headers
  31. plug MyAppWeb.CommonLogic, repo: MyAppWeb.Repo
  32. end
  33.  
  34. defmodule MyAppWeb.CommonLogic do
  35. import Plug.Conn
  36.  
  37. def init(opts) do
  38. IO.puts("init!!")
  39. opts
  40. end
  41.  
  42. def call(conn, repo) do
  43. IO.puts("call!!!")
  44. conn
  45. end
Add Comment
Please, Sign In to add comment