| 1 |
4 |
defmodule WalletWeb.Endpoint do |
| 2 |
2 |
use Phoenix.Endpoint, otp_app: :wallet_web |
| 3 |
|
|
| 4 |
|
# The session will be stored in the cookie and signed, |
| 5 |
|
# this means its contents can be read but not tampered with. |
| 6 |
|
# Set :encryption_salt if you would also like to encrypt it. |
| 7 |
|
@session_options [ |
| 8 |
|
store: :cookie, |
| 9 |
|
key: "_wallet_web_key", |
| 10 |
|
signing_salt: "3VV41hZ9", |
| 11 |
|
same_site: "Lax" |
| 12 |
|
] |
| 13 |
|
|
| 14 |
|
socket "/live", Phoenix.LiveView.Socket, |
| 15 |
|
websocket: [connect_info: [session: @session_options]], |
| 16 |
|
longpoll: [connect_info: [session: @session_options]] |
| 17 |
|
|
| 18 |
|
# Serve at "/" the static files from "priv/static" directory. |
| 19 |
|
# |
| 20 |
|
# You should set gzip to true if you are running phx.digest |
| 21 |
|
# when deploying your static files in production. |
| 22 |
|
plug Plug.Static, |
| 23 |
|
at: "/", |
| 24 |
|
from: :wallet_web, |
| 25 |
|
gzip: false, |
| 26 |
|
only: WalletWeb.static_paths() |
| 27 |
|
|
| 28 |
|
# Code reloading can be explicitly enabled under the |
| 29 |
|
# :code_reloader configuration of your endpoint. |
| 30 |
|
if code_reloading? do |
| 31 |
|
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket |
| 32 |
|
plug Phoenix.LiveReloader |
| 33 |
|
plug Phoenix.CodeReloader |
| 34 |
|
plug Phoenix.Ecto.CheckRepoStatus, otp_app: :wallet_web |
| 35 |
|
end |
| 36 |
|
|
| 37 |
|
plug Phoenix.LiveDashboard.RequestLogger, |
| 38 |
|
param_key: "request_logger", |
| 39 |
|
cookie_key: "request_logger" |
| 40 |
|
|
| 41 |
|
plug Plug.RequestId |
| 42 |
|
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint] |
| 43 |
|
|
| 44 |
|
plug Plug.Parsers, |
| 45 |
|
parsers: [:urlencoded, :multipart, :json], |
| 46 |
|
pass: ["*/*"], |
| 47 |
|
json_decoder: Phoenix.json_library() |
| 48 |
|
|
| 49 |
|
plug Plug.MethodOverride |
| 50 |
|
plug Plug.Head |
| 51 |
|
plug Plug.Session, @session_options |
| 52 |
|
plug WalletWeb.Router |
| 53 |
|
end |