Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. # lib/cls/endpoint.ex
  2. defmodule Cls.Endpoint do
  3. use Phoenix.Endpoint, otp_app: :cls
  4.  
  5. socket "/socket", Cls.UserSocket
  6.  
  7. # Serve at "/" the static files from "priv/static" directory.
  8. #
  9. # You should set gzip to true if you are running phoenix.digest
  10. # when deploying your static files in production.
  11. plug Plug.Static,
  12. at: "/", from: :cls, gzip: false,
  13. only: ~w(css fonts images js favicon.ico robots.txt)
  14.  
  15. # Code reloading can be explicitly enabled under the
  16. # :code_reloader configuration of your endpoint.
  17. if code_reloading? do
  18. socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
  19. plug Phoenix.LiveReloader
  20. plug Phoenix.CodeReloader
  21. end
  22.  
  23. plug Plug.RequestId
  24. plug Plug.Logger
  25.  
  26. plug Plug.Parsers,
  27. parsers: [:urlencoded, :multipart, :json],
  28. pass: ["*/*"],
  29. json_decoder: Poison
  30.  
  31. plug Plug.MethodOverride
  32. plug Plug.Head
  33.  
  34. # The session will be stored in the cookie and signed,
  35. # this means its contents can be read but not tampered with.
  36. # Set :encryption_salt if you would also like to encrypt it.
  37. plug Plug.Session,
  38. store: :cookie,
  39. key: "_cls_key",
  40. signing_salt: "<omitted>"
  41.  
  42. plug Cls.Router
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement