Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Meteor how to render the templates on server side?

I followed this tutorial and I built this with it: http://x111.meteor.com/ But as you can see the loading is very slow, because meteor loads the data from client side.

I get this error when I want to use the global Template inside Meteor.isServer:

ReferenceError: Template is not defined
at app/products.js:56:3 ...

How do I serve the templates from server side so I don't have to wait for the client?

like image 638
Adam Halasz Avatar asked Feb 26 '13 05:02

Adam Halasz


People also ask

How do I server-side render?

Server-side rendering (SSR) is an application's ability to convert HTML files on the server into a fully rendered HTML page for the client. The web browser submits a request for information from the server, which instantly responds by sending a fully rendered page to the client.

Is Meteor a server-side?

Meteor methods are functions that are written on the server side, but can be called from the client side.

Can we implement server-side template rendering using AJAX?

The structure is displayed before data is visible. For example, The table, rendered in DOM, is displayed when the page gets loaded. Using Ajax, data comes from the server in the form of JSON and then the data gets attached to the table using getElementByID.

What is server side rendering with example?

Server-side rendering is when content on your webpage is rendered on the server and not on your browser using JavaScript. For example, with a typical PHP or WordPress site, the page is loaded from content that is coming via HTTP, which was rendered on the server and comes as fully rendered HTML.


1 Answers

Try this. This package adds support for server side Handlebars in Meteor. It's primarily intended as a stop gap for server side email html until Meteor releases server side rendering support.

> mrt add handlebars-server
like image 65
neftedollar Avatar answered Oct 19 '22 23:10

neftedollar