Code Monkey home page Code Monkey logo

Comments (3)

SaitoWu avatar SaitoWu commented on August 29, 2024

这个有两个解决办法:

  • 在 development 模式下面允许跨域 json 操作.

http://developer.github.com/v3/#cross-origin-resource-sharing

可以参考上面 Github 的 CORS 的配置.

  • 把 Linner 打包好的 public 目录放在 Nginx 下面或者 Sinatra 的 public 目录里面.

然后用 Sinatra 的服务器来启动, 就不会有跨域的问题. ( 我们现在在用这种模式, 不过我们后端是 Java, Rails 类似.

如果是真的跨域问题, 就是要垮服务器取数据.

那就用普通的跨域方案来解决, 跟平时的跨域没有什么区别.

from linner.

i5ting avatar i5ting commented on August 29, 2024

但是我们不希望在linner下开发,然后部署又放到别的服务器上,尤其在开发阶段,很不想这样

有个不太好的办法:

open -a Google\ Chrome --args --disable-web-security

from linner.

SaitoWu avatar SaitoWu commented on August 29, 2024

@i5ting 这个办法挺好, 第一次见. 👍

不过这种完全脱离的确实是会遇到这种跨域的问题.

from linner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.