Allow multiple CORS domain in express js

前端 未结 4 806
予麋鹿
予麋鹿 2020-12-15 22:00

How do I allow multiple domains for CORS in express in a simplified way.

I have

 cors: {
        origin: \"www.one.com\";
    }

    app.all(\'*\', f         


        
4条回答
  •  自闭症患者
    2020-12-15 22:30

    I would recommend the cors-module: https://www.npmjs.org/package/cors It does this kind of stuff for you - check the "Configuring CORS w/ Dynamic Origin"-Section

提交回复
热议问题