title: Connection Error (Couldnt get any Response) unable to post on Mongodb
body: <p>I have tried to post in MongoDB by using postman while posting a text i got a error of (Couldnt get any Response) It is not showing any error to Command nodemon Please help me where i did mistake ..!  what i need to do ?</p>
  
  <p>My <strong>index.js</strong> file is:-</p>
  
  <pre><code>const express = require('express');
  const path = require('path');
  const bodyParser = require('body-parser');
  const cors = require('cors');
  const mongoose = require('mongoose');
  
  const config = require('./configdb/database');
  
  // Connection to database
  mongoose.connect(config.database);
  
  // Connection Success to DB
  mongoose.connection.on('connected',() =&gt; {
      console.log('Connected to the Database ' +config.database);
  });
  
  //on Error while Connecting
  mongoose.connection.on('error',(err) =&gt; {
      console.log('connection ERROR Try Again Database Failed to Connect ' +err);
  });
  
  const app = express();
  const articles = require('./routers/articles');
  
  // Port to start 
  const port = 2200;
  
  // cors middleware
  app.use(cors());
  
  // Set Static Public folder
  app.use(express.static(path.join(__dirname, 'public')));
  
  // Body Parser Middleware
  app.use(bodyParser.urlencoded({ extended: false }))
  app.use(bodyParser.json());
  
  app.use('/articles',articles);
  
  // Index Route
  app.get('/', (req, res) =&gt; {
      res.send('this is initial page for starting all session')
  });
  
  app.listen(port, () =&gt; {
      console.log('server started in' + port)
  })
  </code></pre>
  
  <p>my <strong>articles.js</strong> file is </p>
  
  <pre><code>const express = require('express');
  const router = express.Router();
  const config = require('../configdb/database');
  const Article = require('../models/article');
  
  // Register of article
  router.post('/new-article', (req,res,next) =&gt; {
  
      let article = new Article();
      article.title = req.body.title;
  
      console.log(req.body.title);
      return;
  
      article.save(function(err){
          if(err){
                res.json({success: false, msg: 'Failed to Register the Article' });
  
          } else {
              res.json({success: true, msg: 'New Article is Registered'});
          }
      });
  
  });
  
  module.exports = router;
  </code></pre>
  
  <p>my <strong>article.js</strong> file is </p>
  
  <pre><code>const mongoose = require('mongoose');
  const config = require('../configdb/database');
  
  const ArticleSchema = mongoose.Schema({
      title:{
          type: String,
      }
  });
  
  const Article = module.exports = mongoose.model('Article', ArticleSchema)
  </code></pre>
  
  <p><strong>But I have got the message from 
      <code>article.title = req.body.title;</code></strong> and my error as follows:-</p>
  
  <p><a href="https://i.stack.imgur.com/hq0yG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hq0yG.png" alt="Postman and Nodemon ScreenShot"></a></p>