node.js、backbone、socketio 和 express 和 coffee 脚本都在一起吗? [英] Does node.js, backbone, socketio and express and coffee script all go together?

查看:18
本文介绍了node.js、backbone、socketio 和 express 和 coffee 脚本都在一起吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解最新和最伟大的技术,并很好奇所有这些不同的技术如何结合在一起.

I'm trying to get an overview of what's latest and greatest, and was curious how all these different technologies fit together.

是这样的吗:

Nodejs 是一个网络服务器,主干只是一个可以在 nodejs 上运行的框架?

Nodejs is a webserver, backbone is just a framework that will run on nodejs?

SocketIO 是一个与骨干一起工作的库吗?

SocketIO is a library that works with backbone then?

实际代码可以用 coffescript 编写,编译后将是 javascript.

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.

推荐答案

是的,CoffeeScript 可以毫无问题地与 Node.js 一起使用.事实上,如果你使用默认的 coffee 可执行文件,它就是 Node.js,你甚至不需要编译成 JavaScript 就可以运行它.

Yes, 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.

对于 Backbone,它实际上是一个客户端库.您也可以在这里使用 CoffeeScript,但您需要将代码编译为 JavaScript,因为浏览器只知道 JS.您通常不会在 Node 中运行 Backbone.js.

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.

至于Express,它是一个Node框架,所以预计在Node.js中可以在服务器上工作.

As for Express, it is a Node framework, so it is expected to work on the server in Node.js.

所以,总结一下:

  • 您将使用带有 SocketIO 和 Express 的 Node 服务器端
  • CoffeScript 可以走客户端和服务端
  • 您将在客户端上使用 Backbone
  • 您可能会使用 Backbone.sync 机制从 Backbone 模型与服务器上的 SocketIO 通信

这有帮助吗?

这篇关于node.js、backbone、socketio 和 express 和 coffee 脚本都在一起吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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