Ember.js on the server

I am developing a very dynamic web application through ember.js. The client side interacts with the server-side JSON API. The user can make various options and see data on cubes and filtered data from all kinds of perspectives, where all this data is given from the mentioned API.

The thing is, I also need to create static pages (which Google can understand) from the same data. These static pages are predefined views and do not allow much interaction; they are intended to be used as landing pages for users arriving from search engines.

Naturally, I would like to use as much as I can from my dynamic web application to create these static pages, so the natural direction I was thinking about is to implement a server module to render these pages, which will be reused as much as possible my views and Ember.js code.

However - I can not find any materials. Ember docs says: "Although you can use Ember.js on the server side, this is beyond the scope of this guide."

Can someone point out what could be reused on the server and recommendations for developing the application in such a way as to maximize the use of such reuse?

Of course, if you think that my thinking here does not make sense, I would be glad to hear this (and why) too :-)

Thanks! FROM.

+7
source share
2 answers

Handlebars - Ember templating engine - runs on the server (at least under Node.js). I used it in my projects.

When servicing an HTTP request for a page, you can well use the existing templates: pull the appropriate data from the database, massage it into a JSON object, submit it to the control panel along with the correct template, and then send the result to the client.

+5
source

Take a look at http://phantomjs.org/ You can use it to display pages on a server and return a simple HTML version.

You need to do this by following the googles ajax crawling guide: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started

+3
source