summaryrefslogtreecommitdiff
path: root/lib/lsg_web/endpoint.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lsg_web/endpoint.ex')
-rw-r--r--lib/lsg_web/endpoint.ex15
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