Skip to content

Instantly share code, notes, and snippets.

@dburles
Created August 22, 2014 13:15
Show Gist options
  • Save dburles/dac70f799413d7ad7469 to your computer and use it in GitHub Desktop.
Save dburles/dac70f799413d7ad7469 to your computer and use it in GitHub Desktop.
if (Meteor.isServer) {
Router.handlebars = (function(fn) {
return function (options) {
options.template = Handlebars.templates[options.template];
return fn(options);
};
}(Router.handlebars));
}
Router.configure({
layoutTemplate: 'layout'
});
Router.map(function() {
this.route('home', {
path: '/'
});
this.route('test', Router.static({
path: '/test',
render: function() {
return Assets.getText('test.html');
}
}));
this.route('test-handlebars', Router.handlebars({
path: '/test-handlebars',
template: 'test',
data: function() {
return {
test: 'World!'
};
}
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment