Display project AngularCLI in sevidor NodeJs

0

I have completed a project using Angular CLI and I need to deploy it to a linux server which currently has a version of NodeJs.The built project structure is the one I show below:

My question is about how to get this project deployed on the NodeJs server, I understand that it is possible without installing Angular. If not, please I could use any help very well.

    
asked by Ernesto Garcia Orduñez 19.06.2018 в 16:41
source

2 answers

0

I think you're getting involved: Once you've generated your application with Angular and have done the build, you just have to serve it from a web server. The normal thing is use Apache or Ngnix (the two most popular), but of course you could also use it from a server created from NodeJS If this is what you are looking for, you could mount it using link very quickly.

    
answered by 19.06.2018 в 17:13
0

Angular-cli is a development tool with which you can have a development environment and also generate the production ones, in your node, apache or iis server.

You just have to run on the command line:

ng build --prod --build-optimizer

This generates the necessary files in the folder that you have configured by default is usually dist and makes some optimization for production

In case your angular application is not on domain www.misiotio.com/ if not in a subfolder like www.misiotio.com/miapp/angular/

ng build --base-href=/miapp/angular/

And now you can copy the files and publish your app.

Angle-cli documentation for deployment

Anchor-cli documentation

    
answered by 19.06.2018 в 17:02