endpoint.ex 768 B

1234567891011121314151617181920212223242526272829303132
  1. defmodule Hello.Endpoint do
  2. use Phoenix.Endpoint, otp_app: :hello
  3. # Serve at "/" the given assets from "priv/static" directory
  4. plug Plug.Static,
  5. at: "/", from: :hello, gzip: false,
  6. only: ~w(css images js favicon.ico robots.txt)
  7. # Code reloading will only work if the :code_reloader key of
  8. # the :phoenix application is set to true in your config file.
  9. if code_reloading? do
  10. plug Phoenix.LiveReloader
  11. plug Phoenix.CodeReloader
  12. end
  13. plug Plug.Logger
  14. plug Plug.Parsers,
  15. parsers: [:urlencoded, :multipart, :json],
  16. pass: ["*/*"],
  17. json_decoder: Poison
  18. plug Plug.MethodOverride
  19. plug Plug.Head
  20. plug Plug.Session,
  21. store: :cookie,
  22. key: "_hello_key",
  23. signing_salt: "DNlAnJ2o"
  24. plug :router, Hello.Router
  25. end