将Ember与Express JS集成 [英] Integrating Ember with Express JS

查看:97
本文介绍了将Ember与Express JS集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是使用Express.Js引擎和ember.js为MVC结构构建一个项目。



我想知道是否有任何提示,或链接到资源,可以帮助我设置文件结构以及如何将路由与MVC集成。

解决方案

我们正在使用由riak支持的ember / express / node,在我们的解决方案中,ember.js应用程序将与快速REST服务器通信。我们使用的是: https://github.com/nathanaschbacher/chinood



基本上,ember应用程序下载一次,完全在客户端的浏览器中运行,使api在需要时从数据(从您的快速应用程序)请求。您可以阅读有关如何在这里使用余烬数据:
https://github.com/emberjs/data



根据您使用的数据存储,您很可能需要在快速应用程序和ember应用程序中对模型进行一些表示。 Ember以关系方式呈现模型,因此根据实际存储数据的方式,在快速应用程序中构建的模型可能会有所不同。



此外,我们使用铱来保持文件分离,项目组织。以下是一个链接:
https://github.com/radiumsoftware/iridium/


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.

解决方案

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/

这篇关于将Ember与Express JS集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆