Hacker News new | past | comments | ask | show | jobs | submit login

The model. For example, including a backbone.js collection/model definition in the server-side node environment and serving the same model code to the client. The controller-y stuff will be different on each: on the node server the model is persisted by overwriting backbone.sync backbone-redis, and the client could choose to do local caching by extending the sync function with a localstorage plug-in.

For the client-server communication, by default backbone.sync on the client uses restful cruddy urls (for rails), which would need to be handled in a node.js router. There's a lot of boilerplate-type stuff out there to help handle routing those urls, building on e.g. express.js. It seems to be more straightforward on rails which already established conventions.

That's probably why a lot of the backbone/node demos and tutorials forego the restful server interface. Its simpler to just do client-server communication using a real-time pipe like socket.io (which itself is shared code on the server the client). not restful but comes with an added wow factor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: