Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. this.route('rawdata', {
  2. path: '/raw/:collection',
  3. layoutTemplate: 'nolayout',
  4. template: 'raw'
  5. })
  6.  
  7. <template name="direct_layout">
  8. {{> yield}}
  9. </template>
  10.  
  11. this.route('rawdata', {
  12. path: '/raw/:collection',
  13. layoutTemplate: 'direct_layout',
  14. template: 'raw'
  15. });
  16.  
  17. this.route('serverRoute', {
  18. where: 'server',
  19. path: '/your-route',
  20. action: function() {
  21. var data = {this_is:'a json object'}
  22.  
  23.  
  24. this.response.writeHead(200, {'Content-Type': 'application/json'});
  25. this.response.end(JSON.stringify(data));
  26. }
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement