feat(ws): send history data and update data with web socket

Added following logic:
1. New clients receive 15 entry history from history file
2. After that, every 10 seconds when new entry is generated it is sent
out to all connected clients
This commit is contained in:
Leons Aleksandrovs
2025-07-07 16:21:54 +03:00
parent 675f12906e
commit ab26e9881f
5 changed files with 40 additions and 16 deletions

6
backend/consts.js Normal file
View File

@@ -0,0 +1,6 @@
// Define global constants for min and max values
export const MAX = 100;
export const MIN = 0;
// Define range for random number generation
export const RANGE = 0.3; // +-0.3 -> +-30% of previous number