Integration of Node.js and Backbone.js

2019-03-07 18:04发布

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

7条回答
一纸荒年 Trace。
2楼-- · 2019-03-07 18:24

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

查看更多
【Aperson】
3楼-- · 2019-03-07 18:29

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楼-- · 2019-03-07 18:29

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

查看更多
祖国的老花朵
5楼-- · 2019-03-07 18:30

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.

查看更多
手持菜刀,她持情操
6楼-- · 2019-03-07 18:38

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

查看更多
贪生不怕死
7楼-- · 2019-03-07 18:41

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

查看更多
登录 后发表回答