botmasterai / botmaster

The chatbot framework for your serious projects
http://botmasterai.com/
MIT License
251 stars 47 forks source link

Replace Express with uWebSocket #16

Closed ansarizafar closed 7 years ago

ansarizafar commented 7 years ago

Consider replacing expressjs with uWebScket performance gain is huge https://github.com/uWebSockets/uWebSockets/wiki/(More-than)-one-million-requests-per-second-in-Node.js

A complete example of a Facebook messenger bot with wit.ai would greatly help new bot developers.

jdwuarin commented 7 years ago

That looks very interesting. Was planning on making changes regarding the server for v3. uWebSocket might be the one picked.

I'll be working on a wit.ai guide later next week. Hopefully that'll help.

jdwuarin commented 7 years ago

So looking some more at uWebSocket and it looks like it provides developers with a replacement http server. And theoretically should work with express. However, it doesn't as uWebSocket.http doesn't implement everything node's http server does. In this case, listeners don't seem to be implemented yet. That alongside the fact that it is still in alpha make me say that it would be best to wait until it is more mature to replace the default server within botmaster.

Express is still used under the hood and the preferred way for now as it is so widely used and most node.js developers trying to implement their own bot class would know how to deal with a simple node router to add potential webhook routes.

I'll close this issue once the botmaster-wit.ai package and the accompanying guide is out.

ansarizafar commented 7 years ago

Agreed.

jdwuarin commented 7 years ago

Botmaster v3 does not have Express as a dependency anymore. It has just been merged to master and Documentation for it will come out shortly. Because it only relies on a server, It might even work with this.