對於Chrome擴展項目,我創建了一個簡單的HTML + JavaScript頁面來測試Neo4j的REST API。我有Neo4j Community Edition 3.0.6,運行在http://localhost:7474/
,可以連接到/瀏覽器頁面。我在Ubuntu 16.04Neo4j:從Ubuntu的JavaScript連接到localhost:7474/REST API 16.04
當我在localhost/
從頁面連接發展中,我得到的錯誤:
XMLHttpRequest cannot load http://localhost:7474/db/data/ . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://localhost ' is therefore not allowed access. The response had HTTP status code 401.
Error: 0(…)
我明白,我需要建立的Apache2在Ubuntu 16.04允許端口7474到包括'*'的'Access-Control-Allow-Origin'標頭。
我加入以下行/etc/apache2/apache2.conf
並重新啓動服務器,但我仍然看到的錯誤:
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
Header always set Access-Control-Allow-Origin "*"
更何況還是別的什麼,我需要做什麼?
所以我的問題變成:我需要代理流量端口7474的步驟是什麼? –
你應該發佈一個新問題(檢查谷歌還沒有答案給你......),因爲這完全改變了你當前問題的範圍 –