title: Not Have To Specify Middleware for each Router express
body: <p>In Express, I'm using different routers for each of my routes, like this:</p>
  <pre><code>const express = require('express');
  const postRouter = require('./postRouter');
  const userRouter = require('./userRouter');
  const app = express();
  
  
  app.use('/posts', postRouter);
  app.use('/users', userRouter);
  </code></pre>
  <p>And then in my router files, I have the routes.</p>
  <p>However, let's say that on all my pages I'm using sessions. If I want to do this, I have to say <code>router.use(sessionMiddleware);</code> in each router file.</p>
  <p>My question is is that if I can still use multiple routers without having to specify the middleware in each file. I've tried <code>app.use();</code> but that doesn't work.</p>
  <p>Thank you</p>