Web applications 流星无限重定向而不是渲染404
我在my/lib/router.coffee中有一个简单的iron路由器配置:Web applications 流星无限重定向而不是渲染404,web-applications,meteor,routing,iron-router,html-framework-7,Web Applications,Meteor,Routing,Iron Router,Html Framework 7,我在my/lib/router.coffee中有一个简单的iron路由器配置: Router.configure notFoundTemplate: "notFound" Router.map -> @route "app", path: "/" template: "app" 当进入/it时,它是有效的,但如果我尝试转到/abc,它会将我重定向到/#!abc之后,它会在/abc处重定向我,并不断重复(我在浏览器的地址栏、浏览器日志重定向from/to/abc和
Router.configure
notFoundTemplate: "notFound"
Router.map ->
@route "app",
path: "/"
template: "app"
当进入/it时,它是有效的,但如果我尝试转到/abc,它会将我重定向到/#!abc之后,它会在/abc处重定向我,并不断重复(我在浏览器的地址栏、浏览器日志重定向from/to/abc和back中看到这些更改)。我从未看到404错误
有没有人遇到过这样的行为
我使用Meteor v1.0.2.1。这是我的流星名单:
alethes:lodash 0.7.1
appcache 1.0.3
coffeescript 1.0.5
ground:localstorage 0.1.7
ground:store 0.1.1
ianhorst:bower 0.0.2
iron:router 1.0.6
meteor-platform 1.2.1
meteorhacks:kadira 2.15.2
peerlibrary:async 0.9.0_3
rzymek:moment 2.8.3_10
rzymek:moment-locale-ru 2.8.4
我还在客户端使用Framework7。尝试在对Router.configure()的调用中添加默认layoutTemplate。notFoundTemplate设计用于填充主布局模板的产量,而不是用作替换布局模板。您拥有的是旧的iron router API,在新的iron router API中,我的最后一条路线如下所示:
Router.route('/(.*)', function() {//regex for every route, must be last
if (this.ready()) {
document.title = "404";
this.render('error');
} else this.render('loading');
})
我已经使用了这个网址,这是我需要的。但在我看来,这并不能解释无休止的重定向。由于iron router没有404错误,因此,正如您所见,我以某种方式执行了404错误,请尝试使用它而不是router。配置供进一步参考:此错误仅在启用
appcache
包时发生。