How to add 'res.addHeader(“Access-Control-Allow-Origin”, “*”)' in express js?

前端 未结 1 834
难免孤独
难免孤独 2020-12-22 01:24

In my app I use angularjs and cordova for front-end and express and node js for backend which is acting as server. My client side is running on http://localhost:9000 but, my

相关标签:
1条回答
  • 2020-12-22 02:02

    I'm also started learning about this and while searching I found related to this.

    Access-Control-Allow-Origin only accepts * or a single origin.

    If you want to support multiple origins but not all of them, then you must:

    look at the Origin request header check if it is on your list of acceptable origins put it in the Access-Control-Allow-Origin response header

    See this if it could be helpful to you.

    No 'Access-Control-Allow-Origin' - Node / Apache Port Issue

    0 讨论(0)
提交回复
热议问题