草庐IT

javascript - 脊椎、node.js (express) 和 Access-Control-Allow-Origin

我正在本地电脑上开发一个应用程序。前端应该使用spinjs构建,后端API应该使用node.js。Spine在端口9294上运行,node.js在端口3000上运行。在Spine中,我在模型中添加了以下内容:@url:"http:localhost:3000/posts"在我的express服务器中app.get('/posts',function(req,res){console.log("givingALLtheposts");res.header("Access-Control-Allow-Origin","*")res.json(posts);});但我总是在chrome中收到