title: why post json data not receive in node.js?
body: <p>when i post json data on node server, it leads to error 
  'Response to preflight request doest't pass access control check'
  but when i post same request on php server it works .
  <a href="https://i.stack.imgur.com/O5rLC.png" rel="nofollow noreferrer">browser console picture</a></p>
  
  <p>can someone tell me why this not working in node.js but
  when i tried to post data through postman on node server now no error it works.</p>
  
  <p><a href="https://i.stack.imgur.com/HcO2a.png" rel="nofollow noreferrer">postman picture</a></p>
  
  <p>here is my nodeJS code </p>
  
  <pre><code>const express = require('express');
  const app = express();
  app.use(express.json());
  
  app.post('/post', function(req, res){
    res.header('Access-Control-Allow-Origin', '*');
    res.send(req.body);
  })
  </code></pre>
  
  <p>and this is request code that is send from browser</p>
  
  <pre><code>function callAjax(){
    jQuery.ajax({
      method: 'POST',
      url:'http://localhost:3010/post',
      "headers": {
          "content-type": "application/json"
      },
      data: {
          email:'fake@mail.com'
      },
      success: function(data){
          console.log(data);
      },
      error: function(err){
          console.log(err);
      }
     });
   }
  </code></pre>