MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / bootDev

Function bootDev

src/boot.js:28–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26};
27
28const bootDev = () => {
29 loadCSS(`${DEV_ORIGIN}/build/main.css`);
30 loadScript(`${DEV_ORIGIN}/build/main.js`);
31
32 const wsProto = DEV_PROTO === "https" ? "wss" : "ws";
33 const connectWS = () => {
34 let ws;
35 try {
36 ws = new WebSocket(`${wsProto}://${DEV_HOST}:${DEV_PORT}`);
37 } catch {
38 setTimeout(connectWS, 1000);
39 return;
40 }
41 ws.onmessage = ({ data }) => {
42 if (data === "reload") location.reload();
43 };
44 ws.onclose = () => setTimeout(connectWS, 1000);
45 ws.onerror = () => {};
46 };
47 connectWS();
48};
49
50const bootProd = () => {
51 loadCSS("./build/main.css");

Callers 1

boot.jsFile · 0.85

Calls 3

loadCSSFunction · 0.85
loadScriptFunction · 0.85
connectWSFunction · 0.85

Tested by

no test coverage detected