I have created my rest application in Loopback 4 and now I want to implement socket in it. Is there any way to do so in RestApplication?
export class MyApplication extends BootMixin(
ServiceMixin(RepositoryMixin(RestApplication)),
) {
constructor(
options: ApplicationConfig = {}
) {
super(options);
}
....
async start() {
await super.start();
const io = socketio(this.restServer);
io.on('connection', (socket: any) => {
console.log('connected');
});
}
}
const io = socketio(this.restServer);
isn't working for me