#How enable CORS on Vercel?

1 messages · Page 1 of 1 (latest)

craggy abyss
#

I'm got 504 vercel error because vercel can't access my MongoDB server. I'm using Mongoose ORM lib.

My app use google maps api and also has cors problem.

#

How implement this on Remix?

vapid mason
#

CORS is used to enable cross browser requests, it shouldn’t affect your connection to the database

craggy abyss
#

I think I have two problems then.

#

On "development" local machine all work fine.

craggy abyss
#

How to change "Same Origin" policy?

vapid mason
#

That’s a header you add to your responses

craggy abyss
#

What the effect thist on root.server.tsx?

vapid mason
#

the HeadersFunction is only used for document requests

#

which shouldn't have CORS issues because you usually do a request to get data and not HTML

craggy abyss
#

I've solve the cors problem. Now, about MongoDb server, on server logs, i can identify the vercel connection on realtime, but vercel can't get response. Instead receive time out

vapid mason