refactor: remove WebSocket implementation and switch to HTTP-only sync with configurable polling interval

This commit is contained in:
2025-10-26 15:12:45 +01:00
parent 74fecb3ec2
commit 394ebfd76c
11 changed files with 171 additions and 391 deletions
+2 -5
View File
@@ -8,8 +8,6 @@ import fieldRoutes from './routes/fieldRoutes';
import itemRoutes from './routes/itemRoutes';
import syncRoutes from './routes/syncRoutes';
import webRoutes from './routes/webRoutes';
import { createServer } from 'http';
import { initWebSocket } from './ws';
dotenv.config();
@@ -48,9 +46,8 @@ app.use('/', webRoutes);
console.log('- Items');
console.log('- ItemValues');
const server = createServer(app);
initWebSocket(server);
server.listen(PORT, () => {
// Start HTTP server (WebSocket removed)
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);
const dbClient = (process.env.DB_CLIENT || process.env.DB_TYPE || 'sqlite').toLowerCase();