Node.js和Backbone.js的集成 [英] Integration of Node.js and Backbone.js

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

问题描述

我已经对Node.js和Backbone.js进行了大量阅读;我已经阅读了一些教程,并完成了有关Code School的相关课程.我觉得我对每种技术在Web应用程序上下文中提供的功能都有很好的了解.

I have done considerable reading on both Node.js and Backbone.js; I've read some tutorials and done the relevant courses on Code School. I feel that I've got a pretty good idea of the functions that each technology serves in the context of a web application.

我的问题是我真的不知道如何集成这两种技术并串联使用它们.如果有人可以将我指向使用Node,MongoDB和Backbone进行应用程序整个开发的资源,我将不胜感激.

My problem is that I don't really know how to integrate the two technologies and use them in tandem. I would really appreciate if someone could point me to a resource which goes through the entire development of an application using Node, MongoDB, and Backbone together.

非常感谢

推荐答案

这是一个很好的教程,展示了如何设置整个堆栈.

This is a good tutorial that shows how to setup that entire stack.

http://backbonetutorials.com/nodejs-restify-mongodb-mongoose/

简而言之...

您可以使用 restify 之类的库为您的客户端提供一个宁静的API骨干网应用程序.它还可以为Backbone应用程序提供静态资产.该示例使用restify,但可以通过其他库(例如表达式)来实现.

You can use a library like restify to provide a restful API for your client-side Backbone application. It can also serve your static assets for your Backbone application. The example uses restify, but could be accomplished with other libraries like express.

Mongoose 是MongoDB的javascript抽象层.这提供了一种从Node.js与MongoDB进行交互的简便方法.

Mongoose is a javascript abstraction layer for MongoDB. This provides an easy way to interact with MongoDB from Node.js.

您的Backbone应用程序可以利用您的 restify node.js后端来处理模型同步.您应该有足够的控制权来通过 restify 设置路由,以使Backbone开心.

Your Backbone application can utilize your restify node.js backend to handle the model synchronization. You should have plenty of control to setup the routes via restify in a way that makes Backbone happy.

这篇关于Node.js和Backbone.js的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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