endpoint.ex 829 B

123456789101112131415161718192021222324252627282930313233
  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. socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
  11. plug Phoenix.LiveReloader
  12. plug Phoenix.CodeReloader
  13. end
  14. plug Plug.Logger
  15. plug Plug.Parsers,
  16. parsers: [:urlencoded, :multipart, :json],
  17. pass: ["*/*"],
  18. json_decoder: Poison
  19. plug Plug.MethodOverride
  20. plug Plug.Head
  21. plug Plug.Session,
  22. store: :cookie,
  23. key: "_hello_key",
  24. signing_salt: "DNlAnJ2o"
  25. plug Hello.Router
  26. end