Node.js MVC 框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5248582/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Node.js MVC framework
提问by Aleksandar Vucetic
I would like to use Node.js to develop a website. I've seen a lot of frameworks here: https://github.com/joyent/node/wiki/modules#web-frameworks-microbut do not know which one is the most accepted by the community (let's say: the most popular). Did anyone tried any of these frameworks and/or used it in production and what is your experience? Thanks.
我想使用 Node.js 开发一个网站。我在这里看到了很多框架:https: //github.com/joyent/node/wiki/modules#web-frameworks-micro但不知道哪个是最被社区接受的(比方说:最受欢迎的)。有没有人尝试过这些框架中的任何一个和/或在生产中使用它,你的经验是什么?谢谢。
采纳答案by Raynos
Express.jsseems to very popular to use as a general framework. Combined with socketio.jsand underscore.jsthese are very popular libraries but they are not MVC.
Express.js作为通用框架使用似乎非常流行。联合socketio.js和underscore.js这些都是非常流行的库,但他们都没有MVC。
For MVC I've only used backbone.js/ spine.jsand can't give any recommendation for the others. I don't think there is a framework with a dominating popularity going yet because node.js doesn't have much use in production.
对于 MVC,我只使用了backbone.js/spine.js并且不能为其他人提供任何建议。我不认为有一个主要流行的框架,因为 node.js 在生产中没有太多用处。
There are statistics for popular downloads with npmsomewhere. See if you can find them.
有npm某处流行下载的统计数据。看看你能不能找到它们。
回答by Dan Midwood
回答by user2137661
Another great MVC framework that is up and coming is Sails.JS. It is inspired by ruby on rails and has features such as socket support, Restful API and more.
另一个即将到来的伟大 MVC 框架是 Sails.JS。它受 ruby on rails 的启发,具有套接字支持、Restful API 等功能。
回答by Jared Hanson
I just released Locomotive, which is an MVC framework inspired by Ruby on Rails.
我刚刚发布了Locomotive,这是一个受 Ruby on Rails 启发的 MVC 框架。
Express is phenomenal, especially for smaller apps. Recognizing that, Locomotive is built completely on top of Express (similar to how Express builds on top of Connect). Locomotive essentially adds a controller layer along with a router that can declare resourceful routes and generates routing helper functions. Internally, everything is powered by Express, which means the view layer remains the same and all middleware can be reused.
Express 非常出色,尤其是对于较小的应用程序。认识到这一点,Locomotive 完全建立在 Express 之上(类似于 Express 建立在 Connect 之上的方式)。Locomotive 本质上添加了一个控制器层以及一个路由器,可以声明资源丰富的路由并生成路由辅助函数。在内部,一切都由 Express 提供支持,这意味着视图层保持不变,所有中间件都可以重用。
One of the bigger hurdles when learning Node is figuring out how to best structure a web application. Locomotive attempts to solve that problem, using conventions from Ruby on Rails, while retaining the full power of Express and Node.
学习 Node 时最大的障碍之一是弄清楚如何最好地构建 Web 应用程序。Locomotive 尝试使用来自 Ruby on Rails 的约定来解决这个问题,同时保留 Express 和 Node.js 的全部功能。
回答by Benny Tjia
There is matador. It is MVC and it consists of many different existing components, such as Klassfor inheritance model, express, hogan.js, and valentine. Backbone.js is pretty much used for client side. For node, i think there's probably only matador that I know.
有斗牛士。它是 MVC,它由许多不同的现有组件组成,例如用于继承模型的Klass、express、hogan.js 和 valentine。Backbone.js 几乎用于客户端。对于节点,我认为可能只有我认识的斗牛士。
I'd suggest you against using it if you're to use matador for production or replace your existing MVC platform (or at least have a bottleneck/good reason to use it) since it's pretty new, and your productivity also depends on the javascript resources you have. We ourselves use node.js very extensively (our node.js deployment serves close to +4 Million users to date) and we have a significant number of javascript specialists here..so we experiment a lot and probably look into using matador soon. Hope that helps.
如果您要使用斗牛士进行生产或替换现有的 MVC 平台(或至少有使用它的瓶颈/充分理由),我建议您不要使用它,因为它很新,而且您的生产力还取决于 javascript你拥有的资源。我们自己非常广泛地使用 node.js(迄今为止,我们的 node.js 部署为近 400 万用户提供服务)并且我们这里有大量的 javascript 专家..所以我们进行了大量试验,可能很快就会考虑使用斗牛士。希望有帮助。
回答by Techwraith
Geddy was the original MVC framework for Nodejs, check out http://geddyjs.orgif you're interested.
Geddy 是 Nodejs 的原始 MVC 框架,如果您有兴趣,请查看http://geddyjs.org。
回答by Greg Guida
Just came across a new one called Derbywhich looks like it has a lot of promise. Its main benefit seems to be that it cuts down on a lot of the "glue code" (as they put it) that we often write when trying to use rails and backbone, or django and backbone together. The documentation seems pretty decent for a node framework as well.
刚刚遇到了一个名为Derby的新游戏,它看起来很有前途。它的主要好处似乎是它减少了我们在尝试使用 rails 和主干或 django 和主干一起使用时经常编写的许多“胶水代码”(正如他们所说的那样)。对于节点框架,文档似乎也相当不错。
回答by sg7
There are a few more frameworks which you could check:
还有一些框架可以检查:
ThinkJS https://thinkjs.org/the first Node.js MVC framework that can use full ES6/7 features to develop Node.js application.
ThinkJS https://thinkjs.org/第一个可以使用完整的 ES6/7 特性来开发 Node.js 应用程序的 Node.js MVC 框架。
Feathers http://feathersjs.com/a minimalist real-time framework.
Feathers http://feathersjs.com/一个极简主义的实时框架。
Meteor https://www.meteor.com/
Keystone.js http://keystonejs.com/built on Express and MongoDB (MIT license).
Keystone.js http://keystonejs.com/基于 Express 和 MongoDB(MIT 许可)构建。
seneca.js http://senecajs.org/Everything external to a business logic - such as databases, caches and third-party integrations - is hidden behind microservices.
seneca.js http://senecajs.org/业务逻辑之外的一切——例如数据库、缓存和第三方集成——都隐藏在微服务之后。
Catberry http://catberry.org/was developed to help create apps that use the same codebase on both the server and client environments to render what the client would see as a "Single Page Application".
Catberry http://catberry.org/旨在帮助创建在服务器和客户端环境中使用相同代码库的应用程序,以呈现客户端将看到的“单页应用程序”。
Nuke.js http://nukejs.com/#/Fast framework. The stack contains primus, express, mithril, mongodb and redis
Nuke.js http://nukejs.com/#/快速框架。栈中包含primus、express、mithril、mongodb和redis
Hapi.js http://hapijs.com/rich web application server framework for Node.js.
Hapi.js http://hapijs.com/用于 Node.js 的丰富的 Web 应用程序服务器框架。
total.js https://www.totaljs.com/The framework contains full web server, view engine, SMTP mail sender, localization, image processing, websockets, isomorphic code and a lot of utilities
total.js https://www.totaljs.com/该框架包含完整的 Web 服务器、视图引擎、SMTP 邮件发送器、本地化、图像处理、websockets、同构代码和许多实用程序
回答by Dan Smart
Monorail.js - Ultra lightweight MVC Framework for Node.js https://github.com/runexec/Monorail.js
Monorail.js - Node.js 的超轻量级 MVC 框架 https://github.com/runexec/Monorail.js

