some styling cleanup

This commit is contained in:
Nystik
2026-03-17 12:38:30 +01:00
parent c70b9e9d0f
commit 0738c47ac5
27 changed files with 479 additions and 105 deletions

View File

@@ -1,24 +1,24 @@
const { WebSocketServer } = require('ws');
const { WebSocketServer } = require("ws");
//currently unused
function setupWebSocket(server) {
const wss = new WebSocketServer({ server, path: '/ws' });
const wss = new WebSocketServer({ server, path: "/ws" });
wss.on('connection', (ws) => {
console.log('[ws] Client connected');
wss.on("connection", (ws) => {
console.log("[ws] Client connected");
ws.on('message', (data) => {
ws.on("message", (data) => {
// TODO: handle watch/unwatch subscriptions from client
const msg = JSON.parse(data);
console.log('[ws] Received:', msg);
console.log("[ws] Received:", msg);
});
ws.on('close', () => {
console.log('[ws] Client disconnected');
ws.on("close", () => {
console.log("[ws] Client disconnected");
});
});
// TODO: integrate chokidar file watching and broadcast changes
// This will be implemented once the sync strategy is finalized.
// TODO: maybe integrate chokidar file watching and broadcast changes
return wss;
}