adrianhajdin / project_mern_memories

This is a code repository for the corresponding video tutorial. Using React, Node.js, Express & MongoDB you'll learn how to build a Full Stack MERN Application - from start to finish. The App is called "Memories" and it is a simple social media app that allows users to post interesting events that happened in their lives.
https://youtube.com/playlist?list=PL6QREj8te1P7VSwhrMf3D3Xt4V6_SRkhu
5k stars 1.84k forks source link

CORS issue after deploying to Heroku #107

Open kisyular opened 2 years ago

kisyular commented 2 years ago

I am having cors issue after deploying to heroku `const app = express();

app.use(bodyParser.json({limit: '30mb', extended: true})); app.use(bodyParser.urlencoded({limit: '30mb', extended: true})); app.use(cors());`

ihtishamKhan commented 2 years ago

Hey, add origin to cors options like below: Origin URL should be the client-side URL you have deployed

app.use(cors({ origin: 'http://localhost:3000/' }));