title: Express JS/ MongoDB Post not working
body: <p>I started working on a <code>MERN</code> App today and am trying to write a <code>restful api</code>. First I am using <code>mlab</code> to store my <code>mongodb</code> database. I have succesfully connected to this database after creating a user. I can manually create a <code>collection</code> and inject some data into this <code>collection</code>. From my <code>server.js</code> file I can then get the data stored in here.</p>
  
  <pre><code>MongoClient.connect(db_url, (err, database) =&gt; {
      if (err) return console.log(err);
      var collection = database.collection('memories'); // Collection called memories
      app.listen(3000, () =&gt; {
          console.log("Listening on 3000");
      });
  });
  </code></pre>
  
  <p>Thats all fine and dandy but I want to take it to the next level. I want to write a <code>CRUD</code> api for the collection <code>Memory</code>. Coming from <code>django</code>, I would like to create my <code>model</code> first. Therefore, in my <code>models/memory.js</code>:</p>
  
  <pre><code>var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  
  var MemorySchema = new Schema({
      name: String,
      description: String
  });
  
  module.exports = mongoose.model('Memory', MemorySchema);
  </code></pre>
  
  <p>Then I went ahead and started working on my <code>routes/api/api.js</code>:</p>
  
  <pre><code>let router = require('express').Router();
  let Memory = require('../../../models/memories');
  
  router.use(function (req, res, next) {
      console.log("Something is happening");
      next(); // Request stops at middleware without next()
  });
  
  router.route('/memory')
      .post(function (req, res) {
          let memory = new Memory();
          memory.name = req.body.name;
          memory.description = req.body.description;
  
          memory.save(function (err) {
              if (err) {
                  res.send(err);
              }
              res.json({message: 'Memory Created'});
          });
      })
  
      .get(function (req, res) {
          res.json({message: 'First memory'});
      });
  
  
  module.exports = router;
  </code></pre>
  
  <p>And in my <code>server.js</code> I call this module:</p>
  
  <pre><code>const apiRoutes = require('./routes/api/api');
  app.use('/api/', apiRoutes);
  </code></pre>
  
  <p>However, after testing the post api with <code>postman</code>, it the <code>POST</code> request just takes forever before showing up as <code>Could not get any response</code>. However, the <code>GET</code> request works. What am I missing?</p>
  
  <p>EDIT: So the <code>post</code> function is having trouble saving the model instance...</p>