Working with Express?

Express app crashing or stuck on Express 4? We take it over.

Most Express codebases that reach us were started quickly, grown by several hands, and then left alone for a few Node releases. We read the middleware chain carefully, write down what it actually does, and move it forward without rewriting what did not need to change.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

node.log

still failing

What it is

Express at a glance

Express is the minimalist Node.js web framework created by TJ Holowaychuk in 2010. For years it was the default way to build a Node API: routing, middleware chain, template rendering helpers, almost no magic.

Now under OpenJS Foundation stewardship. Express 4.x was the status quo from 2014 until Express 5.0 released in October 2024 with async-friendly defaults and modernised internals. Still the most-downloaded web framework on npm.

Type
Node.js web framework
First released
2010
License
MIT
Maintained by
OpenJS Foundation
Typically used for
HTTP APIs, Node server apps, SSR shells for front-end frameworks, lightweight microservices

The honest version

Express pros and cons

No technology is all upside. This is where Express earns its place and where it tends to cause trouble.

Where Express is strong

  • Minimalist and unopinionatedThe core is a router, a middleware chain and a handful of helpers. You bring your own database layer, validator, logger and auth, and nothing in the framework fights you about the choice.
  • A middleware for almost everythingSessions, parsers, compression, rate limits, auth strategies: most of what a Node service needs already exists as a published middleware and plugs in with one app.use call.
  • Every Node developer can read itFifteen years of books, courses and Stack Overflow answers mean anyone who has touched Node before can open the file and follow what it is doing.
  • A gentle learning curveA working HTTP server fits in about ten lines of code, which makes it an easy place to start and a sensible choice for a prototype that may never grow beyond one.
  • Flexible routingRoutes can be defined inline, grouped into routers, mounted at prefixes or generated from data, so the same codebase can serve a small CLI shim and a sprawling internal tool.
  • Works with any template engineEJS, Pug, Handlebars or a custom render function all slot in through the view engine hook, which is useful for server-rendered admin pages tacked onto a JSON API.
  • A sound choice for small APIsFor a service with a handful of endpoints and no need for a strict structure, Express gets out of the way and stays out of it.

Where Express bites

  • Every project looks differentBecause the framework has no opinion on auth, validation, error handling or config layout, two Express apps in the same company often share almost no structure. New developers spend their first week learning the local conventions.
  • Async error handling is still awkwardA promise that rejects inside a route handler will crash the process unless every handler wraps its body in try and catch, or the project pulls in express-async-errors. Express 5 improves this, but older code has to be migrated route by route.
  • Middleware order bugs are commonThe chain runs top to bottom, and putting the body parser after the route, or the auth check after the handler, produces behaviour that looks correct in development and quietly misbehaves in production.
  • Express 4 stood for a decadeExpress 5.0 landed in October 2024 after years in beta. It breaks some older middleware, changes how errors propagate from async handlers, and expects a newer Node version than many legacy projects are running.
  • Security is not built inThere is no default rate limiter, no default security headers, no default CSRF protection. Every production app needs helmet, a rate limiter, a session store that is not MemoryStore, and a conscious decision about CORS.
  • No schema validation in the boxRequest bodies arrive as whatever JSON the client sent. Teams add joi, zod or ajv, but nothing in Express pushes you to validate at the edge, so a lot of older code trusts input it should not.

Sound familiar?

Common Express problems we fix

The Express problems that bring people to us, and what you have once each one is fixed.

Cannot read properties of undefined

The app crashes on an unhandled rejection

An async route throws, nothing catches it, and the whole Node process exits. In older Node versions it only warned; now it kills the server.

Every async route caught

express@4.17.1 · node 12

Stuck on Express 4 and an old Node

A long-lived service on a Node version the registry no longer supports, with middleware that has not been updated in years and a package-lock full of advisories.

Upgraded to Express 5 on current Node

admin user: unknown

The previous developer is gone

An Express codebase handed over with no README, no tests, and routes defined in half a dozen different styles. Nobody is sure which endpoints are still used.

Documented and back under control

Can't set headers after they are sent

A route sends two responses

A middleware that calls res.send and forgets to return, so the handler runs afterwards and tries to send again. Looks fine in testing, throws under real traffic.

One response per request, always

MemoryStore is not designed for production

Sessions vanish on every deploy

The default session store keeps data in process memory, so a restart logs every user out and a second instance never sees the first one's sessions.

Sessions in Redis or Postgres

No Access-Control-Allow-Origin header

The browser blocks the API

CORS configured for one origin and then copied between projects, so the new front-end domain is quietly rejected by the preflight.

CORS set per environment

listen EADDRINUSE :::3000

Deploys hang and ports leak

A process that never shuts down cleanly, so the next deploy finds port 3000 still held by a zombie and refuses to start.

Graceful shutdown wired in

npm audit: 47 vulnerabilities

The dependency tree is years out of date

Dozens of transitive packages flagged, some abandoned upstream. Upgrading one breaks another, so nobody has done any of them.

Dependencies current and audited

What we do

Express help, from rescue to rewrite

Call us for one broken route, or hand us the whole service.

Takeover
An Express codebase inherited from a developer who moved on. We read it, document it, and get a release out under your account.
Express 4 to 5 upgrade
Migrated on a branch, run against your tests, and shipped when it is boring. Breaking middleware swapped out before it reaches production.
Node upgrade
Moving off an end-of-life Node version onto a current LTS, with dependencies and build tooling brought along.
Hardening
Helmet, rate limiting, a real session store, input validation at the edge, and audit output that no longer scrolls off the screen.
Rewrites
If an Express service has outgrown the framework, we move it to Fastify or NestJS a route at a time rather than all at once.
Managed Tech
Monitoring, dependency updates and a team to call, on an ongoing basis.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Express alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Express questions

Something else? Call+1 737 727 7327

Can you upgrade our Express 4.x API to Express 5?

Yes. We run the upgrade on a branch, sweep the middleware list for anything that no longer works with Express 5, migrate async error handling, update the Node version alongside it, and only merge when the test suite and a staging run look clean.

Can you take over an Express codebase from a previous developer?

Routinely. We read what is there, write down what each route actually does, get the project building on current Node, add the tests that were missing, and hand back a codebase that another developer can pick up without a briefing.

Why does our Express app crash on an unhandled promise rejection?

An async route handler threw and nothing caught it. Node now exits the process on unhandled rejections instead of just warning. The fix is either wrapping every handler, adopting express-async-errors, or moving to Express 5 where async errors flow into the error middleware on their own.

Should we rewrite our Express API in Fastify or NestJS?

Often not. A well-kept Express app is a fine thing to run. If the service has grown beyond what the framework helps with, we move it piece by piece rather than in one go, so you keep shipping while the rewrite happens.

How do we add proper authentication to an Express app?

It depends on who the users are. For first-party users a session cookie backed by a real store is usually right. For third-party clients or mobile apps, signed tokens through a vetted library. We pick one, put it behind a small module, and keep it out of every route handler.

How much does Express help cost?

Estimates are free. Describe what is wrong or what you want upgraded and you get a price before any work begins.

Free estimate

Express app giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.