Preface:
With the project in-depth practice, NG project development, construction, deployment is also more and more clear, please follow the small to see it. Text: Frame Build
ng New MyProject
CNPM Install
ng Serve construction
Development environment Building: NG Build
Production environment construction: NG build--env=prod Server Deployment
1.tomcat deployment: After the construction of the package, placed under WebApps, start Tomcat, Access address: ip+ Port + package name + Host page name
2.nginx deployment: The built package is placed on a nginx server with no specified location, typically placed under usr/local and then configured nginx.conf files,
To configure critical nodes:
<1> Start gzip compression
gzip on;
Gzip_vary on;
Gzip_min_length 1000;
Gzip_comp_level 6;
Gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml Application/xml+rss Text/javascript image/png image/jpeg Appl
<2> Configure access paths
Location/dev {
root/usr/local;
Index index.html;
}
Browser access address: Server ip+ port + configuration Access path name Epilogue:
Simple steps to build, build, deploy easy to handle.