客户端从localhost:8880从localhost:8880调用服务器,但获取跨源请求仅被支持

问题描述:

我有一个html页面与angular2 on url:

I have an html page with angular2 on url:

http:// localhost:8880 / SupporTool / html / angular2 / index。 html#

localhost :8880 / SupporTool / Push / SelectMessagesAttributes

如何获得

code>只支持跨源请求..

Cross origin requests are only supported..

必须在Chrome中停用同源策略。

one has to disable same origin policy in Chrome. It blocks all calls from localhost to itself.

使用 - disable-web-security 标志启动chrome

start chrome with the --disable-web-security flag