admin 管理员组文章数量: 1184232
I'm trying to get an overview of what's latest and greatest, and was curious how all these different technologies fit together.
Is it like this:
Nodejs is a webserver, backbone is just a framework that will run on nodejs?
SocketIO is a library that works with backbone then?
And the actual code can be written in coffescript, which when compiled, will be javascript.
What about express then? Could this be used.
Please point out if these are components/frameworks that don't work together etc.
I'm trying to get an overview of what's latest and greatest, and was curious how all these different technologies fit together.
Is it like this:
Nodejs is a webserver, backbone is just a framework that will run on nodejs?
SocketIO is a library that works with backbone then?
And the actual code can be written in coffescript, which when compiled, will be javascript.
What about express then? Could this be used.
Please point out if these are components/frameworks that don't work together etc.
Share Improve this question asked Oct 5, 2011 at 13:24 codecompletingcodecompleting 9,61113 gold badges64 silver badges103 bronze badges 05 Answers
Reset to default 14Yes, CoffeeScript will work with Node.js without problem. In fact, if you you use the default coffee executable, it is Node.js and you don't even need to compile to JavaScript in order to run it.
As for Backbone, it is really a client-side library. You can also use CoffeeScript here, but you need to compile the code to JavaScript since the browsers only know JS. You wouldn't typically run Backbone.js in Node.
As for Express, it is a Node framework, so it is expected to work on the server in Node.js.
So, in summary:
- You'd use Node server-side with SocketIO and Express
- CoffeScript can go client and server
- You would use Backbone on the client
- You would likely use a Backbone.sync mechanism for talking from Backbone models to SocketIO on the server
Does that help?
Node.js is a server side implementation of javascript.
Express is a web framework that sits on top of connect, another nodejs module.
CoffeeScript can be installed as a module to node.js that allows you to execute coffeescript code directly in node.js.
Backbone is a client-side browser library that has nothing to do with node.js and can be used with any server-side web framework.
I know nothing about backbone but zappa (http://zappajs.org/) is the sample of coffeescript + express + SocketIO.
Yep, infact here is a great article showing how you can reuse your backbone.js models on the backend.
http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/
I'm not sure what "express" is, but everything else you've mentioned plays well together.
there's a project to replace the Backbone.Sync code (which is what does all of the calls to the back-end server in Backbone) with an implementation that uses Socket.io: https://github.com/logicalparadox/backbone.iobind
a lot of people write backbone code in coffeescript. you'll find a lot of examples of that around the web, including here on stackoverflow.
hope that helps.
本文标签:
版权声明:本文标题:javascript - Does node.js, backbone, socketio and express and coffee script all go together? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1739379241a2054998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论