美文网首页
node+websocket:Cannot render hea

node+websocket:Cannot render hea

作者: 踏莎行 | 来源:发表于2021-04-17 21:29 被阅读0次

今天在做websocket时候,使用socket io时报的错误,这个错误的解决很简单,就是将导入socket的程序放到监听端口号的下面

app.listen(3000, () => {
    console.log("服务器启动成功");
})
const io = require("socket.io")(app)
io.on("connection", socket => {})

有点不可思议

相关文章

网友评论

      本文标题:node+websocket:Cannot render hea

      本文链接:https://www.haomeiwen.com/subject/bfcplltx.html