diff options
author | href <href@random.sh> | 2021-09-03 04:04:21 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-03 04:04:21 +0200 |
commit | 5399fc818cf821c75f9f19fd00bf7905ba7fe7e3 (patch) | |
tree | 00408724f9778cc7323b1459782a762626d39b6a /lib/lsg_web/endpoint.ex | |
parent | assets.. (diff) |
various fixes, web client wip, pubsub events
Diffstat (limited to '')
-rw-r--r-- | lib/lsg_web/endpoint.ex | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/lsg_web/endpoint.ex b/lib/lsg_web/endpoint.ex index 37f7e84..4dd8151 100644 --- a/lib/lsg_web/endpoint.ex +++ b/lib/lsg_web/endpoint.ex @@ -1,8 +1,6 @@ defmodule LSGWeb.Endpoint do use Phoenix.Endpoint, otp_app: :lsg - socket "/socket", LSGWeb.UserSocket, websocket: true - # Serve at "/" the static files from "priv/static" directory. # # You should set gzip to true if you are running phoenix.digest @@ -30,13 +28,18 @@ defmodule LSGWeb.Endpoint do plug Plug.MethodOverride plug Plug.Head + @session_options [store: :cookie, + key: "_lsg_key", + signing_salt: "+p7K3wrj"] + + + 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, - store: :cookie, - key: "_lsg_key", - signing_salt: "+p7K3wrj" + plug Plug.Session, @session_options plug LSGWeb.Router |