Hacker News new | ask | show | jobs
by bryanlarsen 3917 days ago
3 shiny new techs, and one clunky older one. Why use Express.js instead of its successor Koa.js?
2 comments

In my React (+Redux) applications, Express only plays a very minor part of being the entry point for the server.

Check this out https://github.com/joshhunt/reactapus/blob/master/src/server.... Koa or Express.js wouldn't really make that much of a difference.

If there is no server side functionality, why not use one of the many react static site generators?
Because this isn't a static site. Updates are being fed to the client via websockets.
But neither koa.js nor express.js do websockets. You're holding up a site that would probably be simpler without both koa and express as an example to say that it doesn't make much of a difference whether you choose koa.js or express.js.
We've built a pretty cool library for Express that makes it easy to do WebSocket stuff through Pushpin (a proxy server). http://blog.fanout.io/2015/03/09/stateless-websockets-with-e...

Not that this was covered in the article, but it would be a reason to choose Express as the backend. It would be cool to build something similar for Koa though.

Fair point. I didn't really give this layer too much thought considering the focus of the blog. It could really be any Node.js framework.

Although saying that, if I had chosen Koa.js the stack would have to be called 3REK, or 3RKE :/