Meteor deploy Iron:Router “oops looks like there&#

2019-07-21 04:05发布

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'});

0条回答
登录 后发表回答