title: php to node.js ajax sending does not give response
body: <p>I was trying to post some data from my php page to my node.js server.and I want to get the response from it.</p>
  
  <p>This is the ajax code which I was sending from my php page which is currently executing on the apache server</p>
  
  <pre><code>function encryptCode()
  {
    var value = document.getElementById("code").value;
    $.ajax({
                  url: "http://localhost:3000/insertUser",
                  type: "POST",
                  data: JSON.stringify(value),
                  dataType: 'json',
                  async: false,
                  contentType: 'application/json; charset=utf-8',
                  success: function(data) 
                  {
                      alert(data);
                  }
              });   
  }
  </code></pre>
  
  <p>and I just want to receive it in my node.js page by this code </p>
  
  <pre><code>var BaseController = require("./Base"),
      View = require("../views/Base"),
      model = new (require("../models/ContentModel"));
  
  module.exports = BaseController.extend({ 
      name: "insertUser",
      content: null,
      run: function(req, res, next) {
          model.setDB(req.db);
          var self = this;
  
  
      console.log(data);
  
          /*this.getContent(function() {
          //  var v = new View(res, 'place');
          res.setHeader('Content-Type', 'application/json');
      res.send(JSON.stringify(self.content));
  
  
          });*/
         // console.log("go to hell");
  
  
      },
  });
  </code></pre>
  
  <p>This is a controller of my express.js,which I have redirected from my app.js page with this code</p>
  
  <pre><code>app.all('/insertUser', attachDB, function(req, res, next) {
              insertUser.run( req, res, next);
          }); 
  </code></pre>
  
  <p>will somebody please help me out in the console.log I am getting {} .....</p>