Integrating Ember with Express JS

时光毁灭记忆、已成空白 提交于 2020-01-13 17:48:07

问题


I am aiming to build a project using the Express.Js engine and ember.js for the MVC structure.

I would like to know if anyone has any tips, or links to resources that can help me with setting up the file structure and how to integrate routing with the MVC.


回答1:


We are using ember/express/node backed by riak, and in our solution the ember.js app will be talking to the express REST server. We're using this: https://github.com/nathanaschbacher/chinood

Basically the ember app downloads once and runs entirely in the client's browser, making api requests for data (from your express app) whenever needed. You can read about how ember data works here: https://github.com/emberjs/data

Depending on what data store you are using, you'll most likely need to have some representation of your models in both the express app and the ember app. Ember presents the models in a relational way, so the models that are built in the express app may be a bit different depending on the way you're actually storing the data.

Also, we're using iridium to keep our files separate and the project organized. Here's a link: https://github.com/radiumsoftware/iridium/




回答2:


You can also have a look at Charles Jolley's convoy, which really nice integrates with Node (Better than Iridium, allowing you to easily share code [models, ...] between server & client sides).

(Sorry for the delay, but I think I finally come back with a good news :-)



来源:https://stackoverflow.com/questions/13720791/integrating-ember-with-express-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!