Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Ember.js with Node.js (Express+Tower.js)

I'm looking into solutions for integrating Ember.js with Node.js+Express+Tower.js.

I just started looking into Tower.js (the last couple of hours), and it looks like that the framework provides a nice structure for placing both server-side and client-side code (similar to the assets folder in Rails).

Since everything is in Javascript, I could either place Ember application code:

  1. Entirely on the client, i.e., send everything on first request.
  2. Serve only what is initially needed, and serve the rest only upon request.

In the 2nd solution, one could render the views on the server and send pure HTML.

Also what about the application logic of Ember (controllers, models, states, ...). How can it better be integrated with server-side Javascript (e.g., node.js+Express+Tower.js), so that repeated code is minimized. In an ideal scenario, you define each model/controller/etc once and its used both on the server and on the client.

like image 317
Panagiotis Panagi Avatar asked Apr 14 '12 15:04

Panagiotis Panagi


1 Answers

We are integrating Ember.js into the core of Tower.js, this has been planned from the beginning.

  • https://github.com/viatropos/tower/blob/development/test/cases/support/emberTest.coffee

Not quite there yet. But it's happening next.

Ember currently works in Node.js and the Browser, as does Tower. Controllers on the server will work like Rails' with web socket additions. Controllers on the client will work like they do on the server and like with Ember, with web socket support - still fleshing this out.

like image 89
Lance Avatar answered Sep 28 '22 09:09

Lance