This project uses Node.js to simulate WebSocket API requests and generate JSON data in the required format. The simulated data can be easily consumed by any frontend application, whether it is a mobile app or a web application.
-
Clone the repository
-
Open your Terminal
Install dependencies
npm install
or
npm install ws
-
Start the simulation server (This terminal exports the simulated data in JSON format)
node simulate-server.js
-
Run the main project (Open another terminal)
node index.js
-
Generated Data Output The simulated data will be saved automatically into the file:
data.json
WebSocket Endpoint
You can connect using:
ws://localhost:8080