title: Unable to hit my local API route in Express
body: <p>I have a <strong>server</strong> and <strong>client</strong> folder, inside my client folder I have 2 Angular apps <code>/website</code> and <code>/dashboard</code></p>
  
  <p>My current routing setup (just for development) going to <code>/</code> will load the website app and views and <code>/dashboard</code> loads the dashboard up:</p>
  
  <pre><code>//website api ==================================================================
  var website = express.Router();
  app.use('/', website);
  app.use('/', express.static("../client/"));
  console.log(__dirname + "../client/");
  
  website.use(function(req, res, next) {
      console.log(req.method, req.url);
  
      next();
  });
  
  website.get('/', function(req, res) {
      var path = 'index.html';
      res.sendfile(path, { 'root': '../client/website/' });
  });
  
  //dashboard api ================================================================
  var dashboard = express.Router();
  app.use('/dashboard', dashboard);
  
  dashboard.use(function(req, res, next) {
      console.log(req.method, req.url);
  
      next();
  });
  
  dashboard.get('/dashboard', function(req, res) {
      var path = 'index.html';
      res.sendfile(path, { 'root': '../client/dashboard/' });
  });
  
  // API to add new accounts:
  app.post('/api/accounts/', accountsController.create);
  </code></pre>
  
  <p><strong>In my dashboard app, the accounts controller I have the following $resource call:</strong></p>
  
  <p><code>var Account = $resource('/api/accounts');</code></p>
  
  <p><strong>Which is suppose to hit this API on my server main.js:</strong></p>
  
  <pre><code>// API to add new accounts:
  app.post('/api/accounts/', accountsController.create);
  </code></pre>
  
  <p><strong>However currently getting a 404 on the call</strong></p>
  
  <p><img src="https://i.stack.imgur.com/6oQ55.png" alt="enter image description here"></p>
  
  <p>'POST <a href="http://localhost:9999/api/accounts" rel="nofollow noreferrer">http://localhost:9999/api/accounts</a> 404 (Not Found)'</p>