Make Original Layout Template
<template name="direct_layout"> {{> yield}} </template>
Then use this as your layoutTemplate to use your template directly.
this.route('rawdata', { path: '/raw/:collection', layoutTemplate: 'direct_layout', template: 'raw' });
I'm not sure if you use this as a placeholder for your actual code. If you are going to display data using JSON or the actual source text. You might want to use server routes. Instead, you should do something like this:
Please note that this is server-side code, unlike the above, which runs on the client side:
this.route('serverRoute', { where: 'server', path: '/your-route', action: function() { var data = {this_is:'a json object'} this.response.writeHead(200, {'Content-Type': 'application/json'}); this.response.end(JSON.stringify(data)); } });
Look at server-side rendering on Iron-Router: https://github.com/EventedMind/iron-router/blob/master/DOCS.md#server-side-routing
source share