我有一臺服務器的設置,一切都進行得很順利,但我得到約咕嚕服務器:不支持CORS,給人錯誤
.... is not allowed by Access-Control-Allow-Origin
這是因爲這兩個承載我的angularjs網站是繁重的服務器非常奇怪的錯誤在端口9000,我的休息服務端口8678.
無論如何,我發現這個
https://gist.github.com/Vp3n/5340891
這也解釋瞭如何啓用CORS繁重的服務器上,但我的呼嚕聲文件好好嘗試一下牛逼他同...這是我目前我的呼嚕聲文件的一部分
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost'
},
livereload: {
options: {
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
test: {
任何幫助非常感激提前
我有同樣的問題,但這並沒有解決它?你可以看一下嗎? http://stackoverflow.com/questions/19391711/acces-control-allow-origin-with-grunt-server-and-flask-socketio-app?lq=1 – arnoutaertgeerts
如何定義lrSnippet參數?你能提供整個gruntfile嗎? – paweloque
@paweloque這是一個古老的符號連接,它改變了grunt-contrib-connect – netalex