Node.js (Express)

The pick for experienced developers who want jobs, speed or scale from one language.

Node.js runs JavaScript on the server, and Express is its most widely used web framework: minimal, flexible and documented by a decade of tutorials. If you already write JavaScript in the browser, it lets you build the backend without learning a second language.


Who gets this pick

You'll see Node.js when you're building an API or backend service or a shop backend, you're not on shared hosting, you have a fair amount or a lot of coding experience, and your priority is job prospects, shipping quickly or handling lots of users. Newer developers, or anyone who ranked "easy to learn" first, get Flask instead.


Why Node fits

One language everywhere. Sharing validation code, types and even developers between frontend and backend is a real productivity win, and it's why "React + Node" is such a common job description.

Built for I/O. Node's event loop handles many simultaneous connections efficiently, which suits APIs that mostly wait on databases and other services - and real-time features like WebSockets.

The npm ecosystem. Whatever you need - payments, email, auth, PDF generation - there's a maintained package.

Modern Node needs fewer tools. Recent versions include a built-in test runner (node --test), file watching (node --watch) and .env loading (node --env-file=.env). And npm install express now gives you Express 5, which finally catches errors thrown in async route handlers for you.


A first project

  1. Build a notes API with Express and PostgreSQL by following our Node + Express + PostgreSQL guide.
  2. Validate request bodies with a schema library such as Zod instead of hand-written if checks.
  3. Add authentication - sessions with secure cookies are simpler and safer than hand-rolled JWTs for a first app.
  4. Write tests with node:test and Supertest for each endpoint.
  5. Convert the project to TypeScript once it works; you'll appreciate what the types catch.

Hosting and cost

Render, Railway and Fly.io all deploy Node apps from a Git repository; free and trial tiers typically sleep when idle or have usage limits, and always-on instances cost a few dollars a month. On a VPS, run Node under a process manager (systemd or pm2) behind nginx. Pair any of them with a managed PostgreSQL service such as Neon or Supabase.


Mistakes to avoid

  • Blocking the event loop. Synchronous file reads, heavy JSON processing or bcrypt's sync functions inside a request handler stall every other request. Use the async versions.
  • Trusting req.body. Validate everything that comes from a client, on the server, even if the frontend validates too.
  • Committing .env files with database URLs and API keys. Add them to .gitignore before your first commit.
  • CORS by trial and error. Allow your actual frontend origin explicitly instead of *, especially when cookies are involved.
  • Copying Express 4 error-handling patterns (wrapping every handler in try/catch) into Express 5 code, where they're no longer needed.

As you grow

Express is deliberately minimal. When you want more structure, Fastify offers built-in schema validation and better performance, NestJS brings an opinionated, Angular-style architecture for large teams, and Hono targets edge and serverless platforms. The fundamentals you learn in Express carry over to all of them.


Take the quiz All picks