title: What is the difference between "express.Router" and routing using "app.get"?
body: <p>I have an app with following code for routing:</p>
  <pre><code>var router = express.Router(); 
  router.post('/routepath', function(req, res) {});
  </code></pre>
  <p>Now I have to put routing code in different files so I tried to use <a href="https://stackoverflow.com/questions/6059246/how-to-include-route-handlers-in-multiple-files-in-express">this</a> approach, but it is <strong>not</strong> working perhaps because instead of <code>express.Router()</code> it uses:</p>
  <pre><code>app.post(&quot;/routepath&quot;, function (req, res) {});
  </code></pre>
  <p>How can I put routing in different files using <code>express.Router()</code>?</p>
  <p>Why <code>app.get</code>, <code>app.post</code>, <code>app.delete</code>, etc, are not working in <code>app.js</code> after using <code>express.Router()</code> in them?</p>