mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
23 lines
401 B
JavaScript
23 lines
401 B
JavaScript
"use strict";
|
|
|
|
import "phoenix_html";
|
|
|
|
import { Socket } from "phoenix";
|
|
import { LiveSocket } from "phoenix_live_view";
|
|
|
|
const csrfToken = document
|
|
.querySelector("meta[name='csrf-token']")
|
|
.getAttribute("content");
|
|
|
|
const liveSocket = new LiveSocket(
|
|
"/live",
|
|
Socket,
|
|
{params: {_csrf_token: csrfToken}}
|
|
);
|
|
|
|
liveSocket.connect();
|
|
|
|
liveSocket.enableDebug();
|
|
|
|
window.liveSocket = liveSocket;
|