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 . browser console picture
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.
here is my nodeJS 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);
})
and this is request code that is send from browser
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);
    }
   });
 }
 
     
    