January 3, 2024, 20:27
const corsOptions = { origin: 'http://ipadress:3000', methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', credentials: true, optionsSuccessStatus: 204, }; app.use(cors(corsOptions)); But nothing seems to work. these are the response headers in my browser:
GET /getCards?cardName=d undefined Host: localhost:3000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0 Accept:/ Accept-Language: nl,en-US;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate, br Referer: http://ipadress:3000/ Origin: http://ipadress*:3000 Connection: keep-alive Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: cross-site I was hoping someone here might be able to help me who perhaps has run into these issues before.