On the server, I am trying to bind express to socket.io, however, when connecting socket.io, I get the following error in the IDE:
TS2349: This expression is not callable.
Type 'typeof import("***/node_modules/socket.io/dist/index")' has no call signatures.
Code in server.ts:
import * as express from 'express';
import * as http from 'http';
import * as socketIo from 'socket.io';
const app: express.Express = express();
const httpServer: http.Server = new http.Server(app);
const io: any = socketIo();
const port: string | number = process.env.PORT || 3000;
app.use(express.static('public'));
const server: any = httpServer.listen(port, (): void => {
console.log('listening on *:3000');
});