代码之家  ›  专栏  ›  技术社区  ›  user3690467

numxt.js+Socket.io

  •  0
  • user3690467  · 技术社区  · 7 年前

    https://github.com/nuxt/nuxt.js/tree/master/examples/with-sockets

    有人能解释为什么 io 模块正在创建socketio服务器?所有的socketio配置都已经在server.js中完成了,所以这不是 模块冗余?

    1 回复  |  直到 7 年前
        1
  •  1
  •   manniL    7 年前

    有两种不同的方法。这个 server.js 是以编程方式将Nuxt与WebSockets一起使用的示例。使用时 nuxt.config.js io 模块,它工作“独立”。

    引自 me here

    说明也可在 dev 分支( here

    推荐文章