I've been trying to deploy my application to Heroku and it has deployed successfully, but I can't seem to get the backend api to work. Instead of using the sites url, it uses localhost:5000 instead. In heroku , I have set PORT = https://rachael-reddit-clone.herokuapp.com/api
index.js
const PORT = process.env.PORT || 5000;
app.use(express.json());
app.use(cors({credentials:true,origin:'https://rachael-reddit-clone.herokuapp.com'}));
app.get("/",(req,res) => {
res.sendFile(path.join(__dirname,"reddit-clone","build","index.html"))
})
app.get('/api',(req,res) => {
res.send('api section');
})
app.use('/api/user',userRoute);
app.use('/api/community',communityRoute);
app.use('/api/communityMember',communityMemberRoute);
app.use('/api/post',postRoute);
package.json (express )
"engines": {
"node": "12.16.3"
},
"proxy": "https://rachael-reddit-clone.herokuapp.com/api"