0
我正嘗試使用隨CouchDB附帶的jquery.couch.js jQuery插件向我的數據庫發送POST請求。我無法連接到我的數據庫以任何方式和使用下面的腳本一直在測試:無法使用Javascript連接到本地CouchDB
$.couch.urlPrefix = 'http://localhost:5984';
$.couch.info({
success: function(data) {
console.log(data);
}
});
在Firefox使用螢火蟲,我能看到以下錯誤:
"NetworkError: 405 Method Not Allowed - http://localhost:5984/ "
我也得到以下警告:
- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5984/ . (Reason: CORS header 'Access-Control-Allow-Origin' missing).
- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5984/ . (Reason: CORS request failed).
嘗試運行測試的指示,減去運行測試:https://github.com/apache/couchdb-jquery-couch – dandavis