socket.io with express

后端 未结 4 935
借酒劲吻你
借酒劲吻你 2021-02-01 07:44

i have a project and I\'m using socket.io with express ,

so what i need (i tried) is broadcasting a message but from an express action. is this possible i don\'t know ho

4条回答
  •  我在风中等你
    2021-02-01 08:10

    Check out my example repo where I use ExpressJS + Juggernaut(pubsub over socket.io):

    http://github.com/shripadk/express-juggernaut-demo

    This might be overkill for what you need as it uses Publish/Subscribe. But it does, to a certain extent, solve your issue of using regular ExpressJS routes. Checkout the master branch after cloning the repository:

    git checkout master

提交回复
热议问题