diff options
Diffstat (limited to 'lib/web/endpoint.ex')
-rw-r--r-- | lib/web/endpoint.ex | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/lib/web/endpoint.ex b/lib/web/endpoint.ex index a401f54..b54458d 100644 --- a/lib/web/endpoint.ex +++ b/lib/web/endpoint.ex @@ -1,49 +1,47 @@ defmodule NolaWeb.Endpoint do - use Sentry.PlugCapture use Phoenix.Endpoint, otp_app: :nola # Serve at "/" the static files from "priv/static" directory. # # You should set gzip to true if you are running phoenix.digest # when deploying your static files in production. - plug Plug.Static, - at: "/", from: :nola, gzip: false, + plug(Plug.Static, + at: "/", + from: :nola, + gzip: false, only: ~w(assets css js fonts images favicon.ico robots.txt) + ) # Code reloading can be explicitly enabled under the # :code_reloader configuration of your endpoint. - if 42==43 && code_reloading? do - socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket - plug Phoenix.LiveReloader - plug Phoenix.CodeReloader + if 42 == 43 && code_reloading? do + socket("/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket) + plug(Phoenix.LiveReloader) + plug(Phoenix.CodeReloader) end - plug Plug.RequestId - plug Plug.Logger + plug(Plug.RequestId) + plug(Plug.Logger) - plug Plug.Parsers, + plug(Plug.Parsers, parsers: [:urlencoded, :multipart, :json], pass: ["*/*"], json_decoder: Jason + ) - plug Sentry.PlugContext - plug Plug.MethodOverride - plug Plug.Head + plug(Plug.MethodOverride) + plug(Plug.Head) - @session_options [store: :cookie, - key: "_nola_key", - signing_salt: "+p7K3wrj"] + @session_options [store: :cookie, key: "_nola_key", signing_salt: "+p7K3wrj"] - - socket "/live", Phoenix.LiveView.Socket, - websocket: [connect_info: [session: @session_options]] + socket("/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]) # The session will be stored in the cookie and signed, # this means its contents can be read but not tampered with. # Set :encryption_salt if you would also like to encrypt it. - plug Plug.Session, @session_options + plug(Plug.Session, @session_options) - plug NolaWeb.Router + plug(NolaWeb.Router) @doc """ Callback invoked for dynamically configuring the endpoint. |