You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am fairly new to Meteor and am have been trouble getting Meteor-SSR to work for a blog example app I am working on.
With the code shown below, when I do a browser reload of /blog, all that gets output is hi instead of the blog posts. What I want is a list of blog posts (and then also things like meta tags).
Here's the application code:
// main.js
Router.route('/', function() {
this.render("Home")
});
if (Meteor.isServer) {
Router.route('/blog', function() {
var posts = [{slug: 'hi', title: "yo"}, {slug: 'hi', title: "yo"}];
SSR.compileTemplate('blog', Assets.getText('blog.html'));
let html = SSR.render('blog', {posts: posts});
this.response.end(html);
}, {where: 'server'});
}
if (Meteor.isClient) {
Router.route('/blog', function() {
var posts = [{slug: 'hi', title: "yo"}, {slug: 'hi', title: "yo"}];
this.render('Blog', {data: {posts: response.data.data}});
});
}
I am fairly new to Meteor and am have been trouble getting Meteor-SSR to work for a blog example app I am working on.
With the code shown below, when I do a browser reload of
/blog
, all that gets output ishi
instead of the blog posts. What I want is a list of blog posts (and then also things like meta tags).Here's the application code:
Here's the main template:
Here's the template for server-side rendering:
I've also posted my question here:
https://stackoverflow.com/questions/41882213/meteor-ssr-blaze-template-rendering-not-working
The text was updated successfully, but these errors were encountered: