defmodule CentralcloudMy.Endpoint do
  use Phoenix.Endpoint, otp_app: :centralcloud_my, adapter: Bandit.PhoenixAdapter

  socket "/live", Phoenix.LiveView.Socket,
    websocket: [connect_info: [session: {CentralcloudMy.Router, :session_opts, []}]]

  plug Plug.Static,
    at: "/",
    from: {:centralcloud_my, "priv/static"},
    gzip: false

  plug Plug.RequestId
  plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]

  plug Plug.Parsers,
    parsers: [:urlencoded, :multipart, :json],
    pass: ["*/*"],
    json_decoder: Phoenix.json_library()

  plug Plug.MethodOverride
  plug Plug.Head
  plug Plug.Session, store: :cookie,
    key: "_centralcloud_my_session",
    signing_salt: "my_salt_2026",
    same_site: "Lax"

  plug CentralcloudMy.Router
end
