Run ng serve --proxy-config proxy.conf.json
or npm run start
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
- Website can be accessed at the following URL http://3.1.206.225 or https://angular-star-wars.tk on Amazon EC2
- bash command to login -
ssh -A -i "angularstarwars.pem" ubuntu@ec2-3-1-206-225.ap-southeast-1.compute.amazonaws.com
- go to app folder
cd /home/ubuntu/StarWars/
- pull the latest updates
git pull
- build the dist file
sudo ng build --prod --build-optimizer
- restart nginx server
sudo service nginx restart
Reference:
https://joeonsoftware.com/2018/08/12/deploy-an-angular-app-in-production-with-nginx-ubuntu-on-ec2/
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
using ng serve for automatic building development(forever)
https://medium.com/better-programming/how-to-properly-get-angular-and-nginx-working-together-for-development-3e5d158734bf
angular/angular-cli#4951
https://my.freenom.com/clientarea.php?action=domaindetails&id=1065661230
https://www.youtube.com/watch?v=HwZ3wNaM69s
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
https://www.digitalocean.com/community/tutorials/how-to-add-the-gzip-module-to-nginx-on-ubuntu-14-04
- follow the guide
- start the agent with - eval
ssh-agent -s
- add the key
ssh-add <key name>
reference: https://help.github.com/en/articles/connecting-to-github-with-ssh