Express 5 · Middleware

Write middleware

Run code on every request, then call next() to continue.

app.use((req, res, next) => {
  console.log(req.method, req.url);
  next();
});

Official Express 5 documentation

More middleware commands

All middleware commands · Express 5 cheatsheet

Was this page helpful?