DEV Community

Discussion on: Dealing with CORS

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

How do I solve CORS when using Webpack dev server?

A solution is probably with expressjs's cors to allow all when process.env.NODE_ENV === 'development'.

Collapse
 
stegriff profile image
Ste Griffiths

I suppose it's up to you in your Express backend to make sure that the right headers are sent back as described, and that your backend responds to OPTIONS requests if necessary. Express seems to have its own CORS guide here: expressjs.com/en/resources/middlew...

Hope this helps :)