我正在编写一个React JS应用程序,从本地主机:8080运行,然后我自己的网站,使AJAX调用the API that openweathermap.org provides。 然后它让我想知道,对于localhost:8080和我的网站,都说www.mysite.com,AJAX调用从http://api.openweathermap.org/data/2.5/forecast获取数据违反了
我想将我的API托管在单独的域上。我已经配置了我的身份验证拦截令牌在角与承载: config.headers.Authorization = 'Bearer ' + sessionStorage.getItem('token');
在我的我的WebApi2我已经配置了WebApiConfig与CORS。 var cors = new EnableCorsAttribute("http://my