const require = createRequire(import.meta.url);
const port = 2052;
const axios = require('axios');
//EXPRESS
var express = require('express');
var app = express();
app.use(bodyParser.json());
app.use(
bodyParser.urlencoded({
extended: true,
}),
);
app.use(cors())
var serv = require("http").createServer(app);
const io = require('socket.io')(serv, {
path: '/coinflip.io/',
cors: {
origins: [
"*"
]
},
transports: ['websocket', 'polling'],
});
...некоторая логика
app.use(express.static("public"));
// app.use("/views", express.static(__dirname + "/views"));
serv.listen(port, () => {
console.log('start in the *:' + port);
});
Какие есть альтернативы socket.io, чтобы побыстрее работали?