Cors Problems
Hi
I'm trying to host an express server and whenever I make requests from my front end I am getting cors problems.
my backend has app.use(cors()) and I do not get these issues when running my backend locally (on a different port to my front end)
I don't think the server is crashing as I can visit the pages in my browser and it works correctly
any ideas?
6 Replies
Project ID:
5d764c6d-b14c-49e5-8e63-651e03809dfb
The problem was that the code was listening on 'port' instead of 'PORT'. The local variable was in lowercase in the .env file, which caused the issue.
⚠️ experimental feature
5d764c6d-b14c-49e5-8e63-651e03809dfb
I dont believe the issue that the experimental feature describes is the problem:
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
That doesnt seem to work, thank you though.
I believe its something to do with requests to my database failing - making the server think its a cors problem??