Access to XMLHttpRequest at 'http://localhost:3000/api/stations' from origin 'http://localhost:3090' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
이 에러는 CORS(Cross-Origin Resource Sharing) 정책 제한으로 인해 발생합니다. CORS는 웹 브라우저에서 웹 페이지가 해당 웹 페이지를 제공한 도메인과 다른 도메인으로의 요청을 막기 위한 보안 기능입니다.서버가 CORS 정책을 올바르게 구성하지 않았기 때문에 발생하는 것입니다.
app.use(
cors({
origin: true,
credentials: true,
})
);