I have a basic server side route defined in iron-router like:
this.route(\'foo\', {
where: \'server\',
path: \'/foo\',
action: function() {
// handle r
You can definitely check the method and only respond if it's the one you want, e.g., like this:
Router.map(function () {
this.route('route', {
path: '/mypath',
where: 'server',
action: function() {
if (this.request.method != 'GET') {
// do whatever
} else {
this.response.writeHead(404);
}
}
})
});
The second question beats me. It might be possible to use this.next()
somehow, but I'm not sure.