title: I get an error (No 'Access-Control-Allow-Origin' header is present on the requested resource) when I access my react app using Heroku
body: <p>I made a simple chat app using react and socket.io. It all went good,the app worked fine on localhost ,but when I deployed the app with Heroku ,I get the same error. 
  No 'Access-Control-Allow-Origin' header is present on the requested resource</p>
  
  <p>This is how I connect to the server in the react app</p>
  
  <pre><code>import React,{Component} from 'react';
  import './App.css';
  import { SocketProvider } from 'socket.io-react';
  import io from 'socket.io-client';
  
  const socket = io.connect('https://react-zoichenger.herokuapp.com');
  </code></pre>
  
  <p>This is my nodejs server </p>
  
  <pre><code>const express =require('express')
  const socket = require('socket.io')
  
  var cors = require('cors')
  var app = express()
  
  app.use(cors())
  
  const server = app.listen(4000,function(){
    console.log("Connected");
  })
  
  //Socket setup
  const io = socket(server);
  
  
  io.on('connection',(socket)=&gt;{
    socket.on('sendMessage',(data)=&gt;{
      console.log(data);
      io.emit('receiveMessage',data);
    })
    console.log('made socket connection')
  });
  
  </code></pre>