1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/assets/js/app.js

23 lines
404 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;