I'm using Iron Router for my urls and I have this route:
this.route('regionEdit', {
path: '/region/:_id',
waitOn: function() {
return Meteor.subscribe('region', this.params._id);
},
data: function() {
return Regions.findOne({
_id: this.params._id
});
}
});
This works fine when I use this path http://example.com/region/xgok3Etc5mfhtmD7j
Where xgok3Etc5mfhtmD7j
is the _id
of region. However, when I access to http://example.com/region/whatever
, the page renders normally, but without data.
How can I raise a 404 error for this?