5

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?

2
  • On the very basic level Node.js will render anything using built-in Jade templating engine (which is super handy, IMO). I don't understand what's the issue with combining client side rendering. Your app needs to render at least something, at least <head> where you will include JS files, etc. Commented Aug 28, 2012 at 1:35
  • Right, basically at the moment when you request "/" (or anything else that isn't an API endpoint), you get a page with a <head> with scripts in it and an empty body, and the backbone router figures out what to display, grabs it via the API, and renders the body on the client. I'd like to take that existing routing/rendering infrastructure and move to the server so that the initial request gets a body that's already populated, and I'm wondering if there are libraries that make that easier. Commented Aug 28, 2012 at 17:59

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.