SPA Web
The documentation applies to: v0.8.0
Use Angular CLI¶
By default, you can use Angular CLI to build a static website by this command
ng build --prod --deleteOutputPath=true
If you want to apply another environment, use this command
ng build --configuration={your_env} --deleteOutputPath=true
After you run this command successfully, you can check a dist
folder which locates same as package.json
file.
Now you can copy whole web-portal
folder to your deployment (such as wwwroot
on nginx)
Use npm¶
We also prepare some shortcut commands that help you to type quickly
``` JavaScript tab="debug" npm run debug
``` JavaScript tab="docker debug"
// Supports for deploying server-side on docker
npm run docker-debug
``` JavaScript tab="local debug" // Supports for deploying server-side on same PC npm run local-debug
``` JavaScript tab="prod"
npm run prod
Nginx Config¶
By normal way, you want to serve Angular SPA static files. Thus you can copy this simple config to nginx.conf
server {
listen 80;
server_name _;
root /var/www/letportal
location / {
try_files $uri $uri/ /index.html;
}
}