i want implement socket in my loopback4 server API. i have integrate socket in my API but it;s routing is not working.
app.io = require('socket.io')(await app.start());
app.io.on('connection', async function (socket: any) {
console.log('connected', socket.id)
socket.on('disconnect', function () {
console.log('user disconnected');
});
});
it's my code but socket is not connected. i have seen this example.
https://github.com/raymondfeng/loopback4-example-websocket/
but it's work only socket server not working with API server. please suggest me how i can implement.