#Express
9 posts tagged with this topic. ← All tags
-
Express app structure: the folders that keep a growing codebase navigable.
A flat Express project works until it doesn't. Here's a folder structure that separates concerns, scales with the project, and stays readable for new contributors.
-
Rate limiting without a third-party service: the pattern that holds up.
You don't need Redis or an external service to rate limit a Node.js API. Here's the in-process pattern that works for single-instance apps and the point where you need to upgrade.
-
Helmet adds 11 security headers in one line. Here's what each does.
Helmet is a collection of Express middleware that sets HTTP security headers. Here's what each header actually does and why you want it enabled.
-
CORS: the config that works and the one that silently breaks everything.
CORS errors happen in the browser, not the server, which makes them confusing to debug. Here's how CORS actually works and the Express config that gets it right.
-
Validate the request before it reaches your handler.
Putting validation logic inside route handlers pollutes business logic and lets bad input reach your database. Here's how to intercept it earlier with middleware.
-
Router-level vs app-level middleware: picking the wrong one breaks auth.
App-level and router-level middleware behave differently in ways that aren't obvious until auth stops working. Here's what each one does and when to use it.
-
Express error handling has one rule everyone gets wrong: the 4-arg signature.
Error handling in Express works differently from regular middleware. One wrong function signature and your errors silently pass through. Here's how it actually works.
-
The middleware chain is everything in Express. Here's how requests move.
Understanding how a request flows through Express middleware is the foundation of every feature you'll build. Here's how the chain actually works.
-
Express routing patterns that don't turn into spaghetti at scale.
A flat routes file works for 5 endpoints. Here are the patterns that keep an Express app navigable at 50 or 500 endpoints.