简体   繁体   English

通过Node.js而不是像Xampp这样的服务器运行AngularJS Web应用程序的实际优势是什么?

[英]What is the actual advantage of running an AngularJS web app over Node.js instead of a server like Xampp?

As stated in the title, 如标题所述,

I don't really understand how Node.js works and above all why it's actually used to run an AngularJS application (eg in WebStorm IDE this is the default option when you create an AngJS project). 我真的不太了解Node.js的工作原理, 最重要的是为什么它实际上用于运行AngularJS应用程序(例如,在WebStorm IDE中,这是创建AngJS项目时的默认选项)。

I've got this doubt since I could run a simple AngularJS app on an Apache web server (within Xampp) without any involvement of NodeJS. 我有这个疑问,因为我可以在Apache Web服务器上(在Xampp内)运行一个简单的AngularJS应用程序,而无需NodeJS的参与。

Thank you in advance 先感谢您

Node.js is an application platform. Node.js是一个应用程序平台。 It's good for running your applications on. 这对于在您的应用程序上运行很有好处。

Apache HTTPD is a web server. Apache HTTPD是一个Web服务器。 It's good at serving web pages. 擅长提供网页。

They're two very different things, not directly related, and not mutually exclusive. 它们是两个截然不同的事物,不直接相关,也不互斥。

You are correct that many apps can run anywhere, but some benefits we've seen are: 没错,许多应用程序可以在任何地方运行,但是我们看到的一些好处是:

  • Simplicity, especially for web developer also developing the server-side code/config/deploy. 简单性,特别是对于Web开发人员,还开发服务器端代码/配置/部署。
  • Real-time web - easier to add in things like WebSockets and Server Sent Events if you need them. 实时Web-如果需要,可以轻松添加WebSockets和Server Sent Events之类的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM