Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to handle Javascript rendering vs. Server side template
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/7098130/reusing-backbone-views-routes-on-the-server-when-using-backbone-js-pushstate-for">Reusing backbone views/routes on the server when using Backbone.js pushstate for seo/bookmarking</a> </p> </blockquote> <p>I am using <strong>Backbone.js</strong> and bunch of other modules to handle <strong>Single Page App</strong> method. My goals:</p> <ol> <li><p>The site must be SEO-friendly</p></li> <li><p>Server bootstrap html code to client and data stored in JSON models. </p></li> <li><p>Sub-sequence actions are all handled by Javascript (e.g. render new screen, change url using Backbone router).</p></li> </ol> <p><strong>My question is</strong>: <em>how to structure the server to align with Javascript on each router url and keep it <strong>DRY</strong>?</em></p> <p><strong>For example:</strong> if user goes to <code>wwww.mysite.com</code> and then click on some link to go to <code>www.mysite.com/page/2</code>, it must be the same as having him to go to <code>www.mysite.com/page/2</code> directly on first load.</p> <p>This seems to be an old topic but I cannot find any solid resource about best way to handle this on server side without repeating the template code in Javascript.</p> <p>One option I am thinking is to split backend into Node.js and another server to handle API only. The Node.js server somehow share the template construction code as the Javascript frontend</p> <p>Anyways, love to hear some advice and apology if this is not the right place to ask such question.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload