Iron-Router auto routing by name conversion

Once got the idea of Iron Route routing method, Conversion over Configuration popped up in my mind immediately. I have named the templates same as their path, it is boring to type it again in JavaScript code.

Iron Router’s document mentions catchall route with path-regex syntax, but thing can be way far simpler:

Route.route(‘/:path’, function () { this.render(this.params.path); }

Leave a Reply

Your email address will not be published. Required fields are marked *