Integration of Node.js and Backbone.js

隐身守侯 提交于 2019-12-31 07:54:15

问题


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.

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.

Many thanks


回答1:


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

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

In short...

Node.js

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

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

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.




回答2:


This ebook could be useful (it's on Backbone, but uses Node for the backend):

http://addyosmani.github.io/backbone-fundamentals/

You also may want to look at this book:

http://www.amazon.com/Building-Node-Applications-MongoDB-Backbone/dp/1449337392




回答3:


There is also Node Cellar Source.

There is not much explanation about the code, but the app is simple enough to get started and understand the basics layouts of node / backbone

It is, i think, just between an 'Hello World' code and a full app.




回答4:


I use for ap in backbone yeoman https://github.com/yeoman/generator-backbone and you use it with node.js too




回答5:


create rest api: http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/

code backbone on the client: http://coenraets.org/blog/2012/10/nodecellar-sample-application-with-backbone-js-twitter-bootstrap-node-js-express-and-mongodb/

the backbonetutorials.com restify one is out of date. It's best to use express, especially if you plan to do any authorization. It's also more widely used




回答6:


This is a comprehensive tutorial on rolling your own blog with Nodejs, Mongodb and expressjs http://howtonode.org/express-mongodb It's old but with a little effort you can get it to work and learn at the same time




回答7:


I have found this to be the most up to date material on using Backbone.js with node http://amzn.to/1DygKlJ



来源:https://stackoverflow.com/questions/15962121/integration-of-node-js-and-backbone-js

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