Node.js express CORS 허용하는 방법
보통 SPA(Single Page Application)에서는 백엔드로 API서버를 두고해당 서버에서 정보를 받아온 후 프론트에서 랜더링 해주는 방식으로 구현한다.나도 이번에 CMS비슷한 사이트를 구축하고 있다.백엔드는 Node.js에 Express엔진을 올려서 사용하고 있으며 프론트는 React.js를 사용중이다.프론트단에서 API서버로 fetch()를 하고 있었는데 아래와 같은 에러가 발생했다. Failed to load http://localhost:4000/api/login: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not..