Ethereum: Store console.log result into array every 3 second

I can give you an article showing you how to achieve this using JavaScript, HTML and CSS.

Ethereum: Protect the console magazine score massively every 3 seconds

Ethereum: Store console.log result into array every 3 second

In this example, we will use the knot. We will also use Websockets to update the customer every 3 seconds.

server side (Node.js)

`Javascript

Const Express = ASK (‘Express’);

CONST App = Express ();

Const Websocket = ASK (‘ws’);

CONST WSS ​​= New Websocket.server ({port: 8080});

App.get (‘/api/btc/price’, (req, res) => {

Const nest = wss.cept (req, res);

CONST Prices = [];

Socket.on (‘message’, (data) => {

ifon.parsse (data) .Symbol == ‘btc’) {

prices.pusk (json.parsse (data) .Latestprice);

Console.log (Last price: $ {prices [prices.lengh - 1]});

// Specify the last price of the customer

Socket.send (json.stringify ({symbol: ‘btc’, the latest process: prices [prices.garums – 1]}));

}

});

Socket.on (‘close’, () => {

Wss.close ();

});

});

App .listen (8080, () => {

Console.log (‘server listening port 8080’);

});

`

Customer Party (HTML and JavaScript)

`html

Binance Price Tracker

#Caine container {

Font size: 24 pixels;

Font weight: highlighted;

Margin-bottom: 20 pixels;

}

Binance price tracking tool