April 2020
Intermediate to advanced
716 pages
18h 55m
English
When a new bid is placed by a user and emitted over a socket connection, it will be handled on the server so that it's stored in the corresponding auction in the database.
In the bidding controller, we will update the socket event handlers in the socket connection listener code in order to add a handler for the new bid socket message, as shown in the following code.
mern-marketplace/server/controllers/bidding.controller.js:
io.on('connection', function(socket){ ... socket.on('new bid', data => { bid(data.bidInfo, data.room) })})
In the preceding code, when the socket receives the emitted new bid message, we use the attached data to update the specified auction with the new bid information in a function called ...
Read now
Unlock full access