Express is the most popular HTTP server framework built upon Node.js.
Despite being considered not an optimal choice in 2023 (other valid Node.js alternatives exist like Koa or Fastify, and ones based on other runtimes like Elysia or Hono), it’s still worth learning Express because of how much widespread it still is.
NOTE: I remember I had some push back on Twitter by a vocal minority when I mentioned using Express saying “it’s old”, “outdated”, “slow”, “better alternatives exist”, and I considered not including this section, but then I kept running into Express. I was reading the popular O’Reilly book “Web Development with Node and Express” and it uses Express in all the book. The book “Tao of Node”, which I was reading too, mentions “I recommend sticking to Express because its plugin, routing, and middleware patterns are the backbone of every other framework that you may have to use in your work”. Then I saw a YouTuber do a video using Express and stumbled on Remix having 4 official adapters, the only one for Node/Bun being built with Express. And people love and use Express, and if you go work at a company that has a long running product with Node, it might be Express based. Express is everywhere. So, here’s Express. You will find it used everywhere, so you can’t ignore it. But for new projects let me mention I tend to prefer Hono at the moment.
The goal of a framework like Express is to make a lot of common operations simple and abstract the underlying complexity.
Let’s find out how to use it.
prerequisites
- Knowledge of JavaScript
- Knowledge of Node.js