title: Difference Between app.use() and router.use() in Express
body: <p>I was just reading the documentation on express and found these two terms, <code>app.use();</code> and <code>router.use();</code></p>
  
  <p>I know <code>app.use();</code> is used in node for <strong>Mounting a middleware</strong> at a path, and we often use it in most of the node apps. but what is <code>router.use();</code> are they both same? if not, whats the difference ? </p>
  
  <p>I read about router <a href="http://expressjs.com/api.html#router" rel="noreferrer">here</a>. I also found similar questions on SO <a href="https://stackoverflow.com/questions/23607058/what-is-the-difference-between-express-router-and-routing-using-app-get">What is the difference between &quot;express.Router&quot; and routing using &quot;app.get&quot;?</a>
   and <a href="https://stackoverflow.com/questions/14125997/difference-between-app-all-and-app-use">Difference between app.all(&#39;*&#39;) and app.use(&#39;/&#39;)</a>, but they do not really answer my question. Thanks.</p>