title: Getting 404 with AngularJS and mongoose
body: <p>I am getting 404 as response after sending following request. I have also tried with different API names but still getting the same error.</p>
  
  <p>Backend: Node+Express+Mongoose
  Frontend: AngularJs</p>
  
  <p><strong>Frontend code (AngularJS)</strong></p>
  
  <pre><code>$http.post('http://0.0.0.0:8000/users/supervisors', function(response) {
      console.log(response);
  });
  </code></pre>
  
  <p>Backend code (Mongoose+Mongodb)</p>
  
  <pre><code>// Express import
  var express = require('express');
  
  // Mongoose import
  var mongoose = require('mongoose');
  
  // Mongoose connection to MongoDB (database: dummydatabase is readonly)
  mongoose.connect('mongodb://0.0.0.0/dummydatabase', function (error) {
      if (error) {
          console.log(error);
      }
  });
  
  // Mongoose Schema definition
  var Schema = mongoose.Schema;
  var UserSchema = new Schema({
      name: String,
      location: String,
      parentId: Number
  });
  
  // Mongoose Model definition
  var User = mongoose.model('users', UserSchema);
  
  // Bootstrap express
  var app = express();
  
  // Add headers
  app.use(function (req, res, next) {
  
      // Website you wish to allow to connect
      res.setHeader('Access-Control-Allow-Origin', '*');
  
      // Request methods you wish to allow
      res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, DELETE');
  
      // Request headers you wish to allow
      res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
  
      // Set to true if you need the website to include cookies in the requests sent
      // to the API (e.g. in case you use sessions)
      res.setHeader('Access-Control-Allow-Credentials', true);
  
      // Pass to next layer of middleware
      next();
  });
  
  app.get('/users/supervisors', function (req, res, next) {
      User.find({}, function (err, docs) {
          res.send(docs);
      });
  });
  </code></pre>