且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

与angularjs 1.2.6跨起源请求错误

更新时间:2022-06-12 00:03:31

我相信battle.platform45是的的允许网页浏览器做他们的服务器直接调用。默认情况下,来自不同领域的网站不能从其他网站访问API的资源。

I believe battle.platform45 is not allowing web browsers to do direct calls to their servers. By default, websites from different domains cannot access API resources from other websites.

由于根据platform45,必须使用Rails创建一个游戏。所以我建议创建自己的服务器,将他们的API服务器调用。然后用你的AngularJS code来访问你的服务器。

As according to platform45, you must use Rails to create a game. So I suggest creating your own server that will call from their API server. Then use your AngularJS code to access your server.

我希望这个图可以更好地说明它:

I hope this diagram can illustrate it better:

Battle.platform45服务器 - (被称为) - >您的服务器 - (被称为) - >您的HTML / JS角code

Battle.platform45 Server -- (is called by) --> Your Server -- (is called by) --> Your HTML/Angular JS Code