title: Get data from NodeJs to ReactJs
body: <p>I built 2 files. One file is my react app what is oppened at 3000 port, and second is my NodeJs server what is oppened at 4000 port. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//Here is my nodejs file 
  var express = require('express');
  var app = express();
  
  app.post('/', function (req, res) {
    res.send('POST request to the homepage');
  });
  
  app.listen(4000, function () {
    console.log('Example app listening on port 4000!');
  });
  
  //Here is my react page 
  import React, { useState, useEffect } from 'react';
  const Home = () =&gt; {
  
    useEffect(async function () {
        const url = 'http://localhost:4000/';
        const response =  await fetch(url);
        const data = await response.json();
        console.log(data)
      });
  
    return(
      &lt;div&gt;
        &lt;h1&gt;Home Page&lt;/h1&gt;
        &lt;p&gt;{data}&lt;/p&gt;
      &lt;/div&gt;
    )
  }
  
  export default Home;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How to send <code>POST request to the homepage</code> from nodejs file to my reactjs file? I tried with fetch but i dind't find a solution to solve the issue. Who know how to do this?</p>