Meteor infinite redirect instead of render 404

后端 未结 2 1518
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 00:19

I have a simple iron-router config in my /lib/router.coffee:

Router.configure
  notFoundTemplate: \"notFound\"

Router.map ->
  @route \"app\",
    path:          


        
相关标签:
2条回答
  • 2020-12-20 01:12

    Try adding a default layoutTemplate in your call to Router.configure(). notFoundTemplate is designed to populate the yield of a main layout template, rather than serve as a replacement layoutTemplate.

    0 讨论(0)
  • 2020-12-20 01:13

    What you have is an old iron-router API, in new one my last route looks like this:

    Router.route('/(.*)', function() {//regex for every route, must be last
        if (this.ready()) {
            document.title = "404";
            this.render('error');
        } else this.render('loading');
    })
    
    0 讨论(0)
提交回复
热议问题