title: 405: Method not allowed error,nodeJS
body: <p>I have exposed some apis in nodeJs
  I am able to perform GET requests, but when I try Post request I am getting following errors</p>
  
  <pre><code>405: Method not allowed error
  {
  "code": "MethodNotAllowedError"
  "message": "POST is not allowed"
  }
  </code></pre>
  
  <p>Other than this I am not able to get any information about error. I tried lots of things like below but none of them working..</p>
  
  <pre><code>global.restify = require('restify');
  global.appRoot = path.resolve(__dirname);
  global.app = restify.createServer({name:'test'});
      app.opts(/.*/, function (req,res,next) {
  
        //  res.header("Access-Control-Allow-Methods", req.header("Access-Control-Request-Method"));
        //  res.header("Access-Control-Allow-Headers", req.header("Access-Control-Request-Headers"));
      //    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  
        //res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
        //res.header("Access-Control-Allow-Headers", "X-Requested-With");
  
        res.header("Access-Control-Allow-Origin", "*");
            res.header("Access-Control-Allow-Headers", "X-Requested-With");
            res.header('Access-Control-Allow-Headers', 'Content-Type');
        res.send(200);
  
          //res.send(200);
          return next();
      });
  </code></pre>