Meteor deploy Iron:Router “oops looks like there's no route on the client or the server for url”

╄→尐↘猪︶ㄣ 提交于 2019-12-11 02:30:59

问题


When I deploy using "meteor deploy mysite.com" or "meteor deploy mysite.meteor.com" I get the error: "oops looks like there's no route on the client or the server for url". I don't have this issue on localhost. I don't see anything unusual on "meteor logs mysite.com"

Basically, if the user is not logged in then the page should be redirected to the welcome page. Here is a snippet of the code. Any ideas?

Router.onBeforeAction(function () {
  if (!Meteor.user() && !Meteor.loggingIn()) {
    this.redirect("/welcome");
  } else {
    this.next();
  }
}, {
  except: [
    "entrySignIn",
    "entrySignUp",
    "entrySignOut",
    "welcomePage"
  ]
});

Router.route("/", {
    template: "homePage",
    action: function() {
        if (Meteor.user()) {
            this.render("homePage");
        } else {
            this.redirect("/welcome");
        }
    }
});
 Router.route('/welcome', {layoutTemplate: 'welcomePage'});

来源:https://stackoverflow.com/questions/29830768/meteor-deploy-ironrouter-oops-looks-like-theres-no-route-on-the-client-or-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!