Is nodejs required for angular2, can i work with apache server?

I am using angular2 with nodejs, how about using apache / xampp. will it support or nodejs npm server is required for angular2

+7
angular npm-install
source share
3 answers

Given the development, NodeJS is a must for angular2!

Let me tell you why?

Angular2 comes with typescript support, which translates to javascript.

NodeJS offers typing and other dependency packages such as SystemJS,RxJS , which helps angular2 do the magic that you call Angular .

Although you can run angular2 applications in Xampp, the recommended approach would be with NodeJS, as it offers much more flexibility and support for development frameworks.

eg. Angular-Cli is a node module that helps you quickly set up a project.

In addition, node provides the flexibility to add third-party libraries to your project.

You can use Xampp, but then you need your server to download the transpiler manually, which will convert the ts files to javascript files, as there is currently no support in Xampp, as far as I know, and this will be quite a difficult task.

So, I will go with NodeJS on this.

For production:

Once you create the package from your application, it can be deployed to any server running javascript. Therefore, in this case NodeJS is not required.

+5
source share

It depends on what we are talking about.

For Development , you must have NodeJS on your development computer to download all the libraries, translate TS, prepare assembly files, etc.

For the Production server, you can use whatever you want if you have already prepared js packages with all the folders and your application, just static files with index.html, css, js, jpg, etc. on..

+4
source share

I will also recommend you go with Oleg Barinov. More than Angular2 applications consist only of static files, therefore they can be served by any static web servers or server applications that can define static folders (Express, ...)

+2
source share

All Articles