I have a project with Vue frontend, Express backend and Mysql as database (using Sequelize as ORM)
In development, the frontend communicates with the backend API without any issues.
When backend deployed on heroku, i can get a valid response when i use postman to query the endpoints
but when i try to do the same from the frontend running on localhost:8080, i get a blocked error as shown in the screenshot

below is my server.js (express startup code) that works when hosted on localhost:5000 and can communicate with the frontend on localhost:8080 but when backend is deployed to heroku, also working through postman, the fontend can't access the API on heroku because it gets blocked
I dont know if this is a CORS issue as the error says nothing about CORS.
const express = require('express');
const cors = require('cors');
const app = express();
app.use(cors());
//routes
const apiRouter = require('./routes/apiRouter');
app.use('/api', apiRouter);
/* -------------------------
Middlewares
------------------------
*/
app.use(cookieParser());
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
app.use(passport.initialize());
app.use(morgan('dev'));
/* Port and start up */
const port = process.env.PORT || 5000;
app.listen(port);