title: nodejs throws cannot post error
body: <p>I am trying to post the data from html form but it is showing an error "cannot POST".</p>
  
  <p>This is my code:</p>
  
  <p>controller/InquiryDetails.js:</p>
  
  <pre><code>   var mongoose = require('mongoose'),
     InquiryDetails = mongoose.model('InquiryDetails');
  
  
     exports.add = function(req, res) {
     InquiryDetails.create(req.body, function (error, details) {
     if (error) return console.log(error); 
     return res.send(details);
    });
    }
  </code></pre>
  
  <p>routes/Inquiry.js</p>
  
  <pre><code> var express = require('express');
    var router = express.Router();
   var bodyParser = require('body-parser');
   var app = express();
  
    app.use(bodyParser.urlencoded({extended:true}));
  
   app.post('/InquiryDetails', function(req,res,err){
   if(err) console.log(err);
   res.json(req.body);
   console.log(req.body);
  
  });
  module.exports = router;
  </code></pre>
  
  <p>model/InquiryDetails.js</p>
  
  <pre><code> var mongoose = require('mongoose');
   var Schema = mongoose.Schema;
  
  var myskyll = new Schema({
    name: String, 
    email: String,
    state: String,
    country: String,
    school: String,
    profession: String,
    phone: Number 
  });
  
    mongoose.model('InquiryDetails', myskyll);
  </code></pre>
  
  <p>app.js:</p>
  
  <pre><code>var express = require('express');
  var mongoose = require('mongoose');
  var request = require('request');
  
  var connect = require('connect');
  var serveStatic = require('serve-static');
  connect().use(serveStatic(__dirname+"/index.html")).listen(8080);
  var mongoUri = 'mongodb://localhost/myskyll'; 
  mongoose.connect(mongoUri);
  var db = mongoose.connection;
  db.on('error', function () {
  throw new Error('unable to connect to database at ' + mongoUri);
  });
  
  var app = express();
  console.log("connection successfull");
  app.configure(function(req,res){
  app.use(express.bodyParser());
  });
  
   app.use(express.static(__dirname + "/" ));
  
   require('./models/InquiryDetails');
   require('./routes/Inquiry');
  
   app.listen(3000);
   console.log('Listening on port 3000...');
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>   &lt;form method="post" id="form1" action="InquiryDetails"&gt;
      Your Name:&lt;span class="imp"&gt;*&lt;/span&gt;&lt;br/&gt;&lt;input type="text"    
       name="name" placeholder="Firstname Lastname" class="textbox"   
       autofocus required pattern="[A-Za-z-0-9]+\s[A-Za-z-'0-9]+"   
       title="'Firstname' &lt;space&gt; 'Lastname'"/&gt; &lt;br/&gt;&lt;br/&gt;
  
      Email:&lt;span class="imp"&gt;*&lt;/span&gt;&lt;br/&gt;&lt;input 
       type="email" name="email" placeholder="Email" class="textbox"  
         required/&gt;&lt;br/&gt;&lt;br/&gt;
  
      city:&lt;span class="imp"&gt;*&lt;/span&gt;&lt;br/&gt;&lt;input type="text" name="city"  
      placeholder="city" class="textbox" required/&gt;&lt;br/&gt;&lt;br/&gt;
  
                      State/Country:&lt;span class="imp"&gt;*&lt;/span&gt;&lt;br/&gt;  
             &lt;input type="text" name="country"  
           placeholder="State/Country" class="textbox" required /&gt;&lt;br/&gt;
         &lt;br/&gt;
  
          School/Institution:&lt;span class="imp"&gt;*&lt;/span&gt;&lt;br/&gt;&lt;input  
       type="text" name="school" placeholder="Your School or  
           Institution" c lass="textbox" required /&gt;&lt;br/&gt;&lt;br/&gt;
  
          Your Profession:&lt;br/&gt;&lt;input type="text" name="profession"  
     placeholder="Profession" class="textbox"&gt;&lt;br/&gt;&lt;br/&gt;
      Phone:&lt;br/&gt;&lt;input type="text" name="phone" placeholder="Phn. no. 
     with country code" class="textbox" pattern="\+[0-9]+" title="Only  
    digits" /&gt;&lt;br/&gt;&lt;br/&gt;
  
  &lt;input type="submit" value="Submit"   
       class="btn3"/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;input type="reset" value="Clear"  class="btn3" /&gt;
  
  
      &lt;/form&gt;
  </code></pre>
  
  <p>I have tried in postman API client to post the data but it shows 404 status while posting the data.
  Do I have any problem in my code?
  Any suggestion will be appreciated!</p>