mean.io vs node-restify和nginx。(mean.io vs node-restify and nginx. Which framework to use for json webservice serving an angularjs app)

到目前为止的故事 - >我们已经构建了一个angularjs应用程序,它由一个单独的html文件和一些轻量级的js文件组成。 整个dom由角度控制。 但是我们需要上传音频文件并保存json对象。 鉴于要发送到浏览器和从浏览器发送的数据的性质,socket.io和mongoose并不是一件容易的事。 但是我对mean.io( http://www.mean.io/ )和node-restify( http://mcavage.me/node-restify/#installation )之间存在疑问。这些回购都有不错的关注。

mean.io使用express和angular.js而node-restify是纯http json服务器。 我有两个选项让我适应mean.io或仅使用nginx托管angular.js应用程序并使json调用node-restify并负责所需的服务器通信。 潜在的节点修复似乎更清晰,但即使我的静态服务器和节点服务器nginx配置共享相同的服务器域,它也会给出CSRF令牌问题

Story so far -> We have built an angularjs app which consists of a single html file and few lightweight js files. Entire dom is controlled by angular . However we need to upload audio files and save json objects. Given the nature of data to be sent to and from browser, socket.io and mongoose is no brainer. However I have a doubt between mean.io (http://www.mean.io/) and node-restify(http://mcavage.me/node-restify/#installation) .Both these repos have decent following.

the mean.io uses express and angular.js while node-restify is a pure http json server. I have two options adapt me to mean.io or host the angular.js app using only nginx and make json calls to node-restify and take care of the server communications required. Potentially node-restify seems cleaner but will it give CSRF token issues even if both my static server and the node server nginx configuration share the same server domain

最满意答案

理想情况下,以上都不是。 除非你正在构建一个非常简单的应用程序,比如博客或TODO列表(令人惊讶的是有多少例子引用这些),使用像Mean或Meteor这样的任何框架(检查这一个)是不可取的。 想想看,这些框架可以让您立刻站起来,但每个自定义行为都需要时间,就像黑客一样

因此,如果您在节点端处理简单的CRUD操作,甚至不使用框架。 编写自己的代码,模块化它。 我认为它的方式是你最终会覆盖任何框架的默认CRUD。

Ideally none of the above. Unless you are building a very simple application like a blog or a TODO list (its amazing how many examples quote these) using any framework like Mean or Meteor(check this one out) is not advisable. Think of it this way these frameworks get you off your feet in no time, but every customized behavior takes time and resembles a hack

So if you have minimalistic CRUD operations anyways to be handled at node end, dont even use a framework. Write your own code, modularize it. The way i see it is that you will end up overwriting default CRUD of any framework sooer or later.

mean.io vs node-restify和nginx。(mean.io vs node-restify and nginx. Which framework to use for json webservice serving an angularjs app)

到目前为止的故事 - >我们已经构建了一个angularjs应用程序,它由一个单独的html文件和一些轻量级的js文件组成。 整个dom由角度控制。 但是我们需要上传音频文件并保存json对象。 鉴于要发送到浏览器和从浏览器发送的数据的性质,socket.io和mongoose并不是一件容易的事。 但是我对mean.io( http://www.mean.io/ )和node-restify( http://mcavage.me/node-restify/#installation )之间存在疑问。这些回购都有不错的关注。

mean.io使用express和angular.js而node-restify是纯http json服务器。 我有两个选项让我适应mean.io或仅使用nginx托管angular.js应用程序并使json调用node-restify并负责所需的服务器通信。 潜在的节点修复似乎更清晰,但即使我的静态服务器和节点服务器nginx配置共享相同的服务器域,它也会给出CSRF令牌问题

Story so far -> We have built an angularjs app which consists of a single html file and few lightweight js files. Entire dom is controlled by angular . However we need to upload audio files and save json objects. Given the nature of data to be sent to and from browser, socket.io and mongoose is no brainer. However I have a doubt between mean.io (http://www.mean.io/) and node-restify(http://mcavage.me/node-restify/#installation) .Both these repos have decent following.

the mean.io uses express and angular.js while node-restify is a pure http json server. I have two options adapt me to mean.io or host the angular.js app using only nginx and make json calls to node-restify and take care of the server communications required. Potentially node-restify seems cleaner but will it give CSRF token issues even if both my static server and the node server nginx configuration share the same server domain

最满意答案

理想情况下,以上都不是。 除非你正在构建一个非常简单的应用程序,比如博客或TODO列表(令人惊讶的是有多少例子引用这些),使用像Mean或Meteor这样的任何框架(检查这一个)是不可取的。 想想看,这些框架可以让您立刻站起来,但每个自定义行为都需要时间,就像黑客一样

因此,如果您在节点端处理简单的CRUD操作,甚至不使用框架。 编写自己的代码,模块化它。 我认为它的方式是你最终会覆盖任何框架的默认CRUD。

Ideally none of the above. Unless you are building a very simple application like a blog or a TODO list (its amazing how many examples quote these) using any framework like Mean or Meteor(check this one out) is not advisable. Think of it this way these frameworks get you off your feet in no time, but every customized behavior takes time and resembles a hack

So if you have minimalistic CRUD operations anyways to be handled at node end, dont even use a framework. Write your own code, modularize it. The way i see it is that you will end up overwriting default CRUD of any framework sooer or later.