Chapter 5. Server-side frameworks

 

This chapter covers

  • Working with popular Node web frameworks
  • Choosing the right framework
  • Building web apps with web frameworks

This chapter is all about server-side web development. It answers questions including how do I choose the perfect framework for a given project, and what are the advantages and disadvantages of each framework?

Deciding on the right framework is difficult because it’s hard to compare them on a level playing field. Most people don’t have time to learn all of them, so we tend to make superficial decisions about the frameworks we have experience with. In some cases, you might use different frameworks together. Express, for instance, could be used for larger applications, whereas microservices that support larger applications could be written in hapi.

Imagine you’re building a content management system (CMS). It’s used to manage legal documents collected by a research firm. It can output PDFs and has an e-commerce component. Such a system could be built with separate frameworks as follows:

  • Document upload, download, and reading— Express
  • PDF generator microservice—hapi
  • E-commerce component— Sails.js

5.1. Personas

5.2. What is a framework?

5.3. Koa

5.4. Kraken

5.5. hapi

5.6. Sails.js

5.7. DerbyJS

5.8. Flatiron.js

5.9. LoopBack

5.10. Comparison

5.11. Writing modular code

5.12. Persona choices

5.13. Summary