title: express http response object does not return data
body: <p>I am attempting to write a server using express js, but when I send a get request to my endpoint from another server, the response is receieved and is successful, but does not contain the data that was sent by the server after <code>res.send(data)</code>.</p>
  <p>here is the server</p>
  <pre><code>const express = require(&quot;express&quot;);
  const app = express();
  const cors = require(&quot;cors&quot;);
  const corsOptions = {
      origin: [&quot;http://localhost:6000&quot;],
      optionsSuccessStatus: 200,
      credentials: true,
  };
  app.use(cors(corsOptions));
  app.use(express.json());
  
  app.get(&quot;/test&quot;, (req, res) =&gt; {
      res.send(&quot;hello&quot;)
  })
  
  app.listen(4000)
  </code></pre>
  <p>and here is the server that is sending the request</p>
  <pre><code>import fetch from &quot;node-fetch&quot;;
  const url = &quot;http://localhost:4000/test&quot;
  import express from &quot;express&quot;;
  const app = express()
  
  fetch(url)
  .then(response =&gt; {
      console.log(response)
  })
  .catch(err =&gt; {
      console.log(err)
  })
  
  
  app.listen(6000)
  </code></pre>
  <p>the response which is returned is not the string sent from the server, but rather the object containing the http response (which is too large to put here), but without the original data, though it specifies a response status of 200 which suggests that the data was sent.</p>
  <p>strangely, the server does return the original data when the request is sent from the command prompt using curl, but the CORS headers explicitly contain the localhost port of the request.
  Am I missing an important piece of information about CORS, or is this error the result of something else?</p>