Redirect 如何修复此CouchDB重写处理程序';什么是无限循环?
如果我在CouchDB应用程序中不使用重写,我的静态文件链接将断开:Redirect 如何修复此CouchDB重写处理程序';什么是无限循环?,redirect,url-rewriting,couchdb,infinite-loop,couchapp,Redirect,Url Rewriting,Couchdb,Infinite Loop,Couchapp,如果我在CouchDB应用程序中不使用重写,我的静态文件链接将断开: GET http://127.0.0.1:5984/mythshare-dev/_design/mythshare/_rewrite/static/js/jquery-1.7.1.min.js 404 (Object Not Found) GET http://127.0.0.1:5984/mythshare-dev/_design/mythshare/_rewrite/static/js/json2.js 404 (Obje
GET http://127.0.0.1:5984/mythshare-dev/_design/mythshare/_rewrite/static/js/jquery-1.7.1.min.js 404 (Object Not Found)
GET http://127.0.0.1:5984/mythshare-dev/_design/mythshare/_rewrite/static/js/json2.js 404 (Object Not Found)
GET http://127.0.0.1:5984/mythshare-dev/_design/mythshare/_rewrite/static/style/example.css 404 (Object Not Found)
modules.js:4264Uncaught ReferenceError: $ is not defined
因此,我添加了此重写以修复断开的链接:
{from: '/static/*', to: 'static/*'}
我断开的链接已修复,但处理程序无法正常工作modules.js
的句柄函数不匹配
exports.handle = function (method, url, data) {
if (exports.unknown_target) {
window.location = exports.getBaseURL() + url;
return;
}
// match resolves to FALSE
var match = exports.matchURL(method, url);
...
这就导致了:
...
else {
// this log is written over and over in the console
console.log(method + ' ' + url + ' -> [404]');
window.location = exports.getBaseURL() + url;
return;
}
页面现在不断刷新,陷入无限循环
如何将重写写入静态目录,使其正确解析并匹配 删除
base.html
模板中modules.js
的脚本标记 这似乎是由于base.html文件模板中包含了一个“modules.js”文件造成的。删除它后,页面将正常工作。不过,我将暂时不讨论这个问题,希望有人知道错误的根本原因并能提供帮助。