Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrofitting an existing Backbone app for server-side rendering with node.js?

I have a web app whose current structure is to render everything in the browser with backbone.js and client-side templates, pulling all dynamic content from a Python-powered JSON API. Some of the app is content-y enough that I wouldn't mind serving it up to Google and supporting non-JS clients, so I've been mulling moving to an architecture where the first request gets handled by a Node app that renders the first page and serves it rendered, after which point Backbone will take over on the client if JS is enabled to render subsequent requests as they work now.

I'm aware of a couple of efforts (like Development Seed's bones) to implement just this kind of strategy, but they seem to expect an app that was planned up-front with their use in mind, which, for better or for worse, mine wasn't.

I'm looking for tools, libraries, etc., that would make this transition easier. Bonus points if it's practical to offer slightly-different experiences in some areas for non-JS clients. Thoughts?

like image 367
Andrew Pendleton Avatar asked Nov 03 '22 17:11

Andrew Pendleton


1 Answers

Airbnb had a good article about this. I imagine this space will progress pretty quickly over the next few months.

http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-to-product

like image 162
philfreo Avatar answered Nov 09 '22 15:11

philfreo