Configurando o Angular Universal na Digitalocean

#step 1
sudo apt update
#step 2
sudo apt upgrade -y
#step 3
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
#step 4
sudo apt-get install -y nodejs nginx build-essential
server {
listen 80;
server_name beta.guim.it;
location / {
proxy_pass http://localhost:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
# To verify nginx configuration
sudo nginx -t
# Restart nginx
sudo service nginx restart
#Step 1
sudo apt install git
#Step 2
git config --global user.name "Your Name"
#Step 3
git config --global user.email "youremail@yourdomain.com"
cd /var/www
npm install -g @angular/cli
#Step 1
ng new frontend
# Step2
cd frontend
ng add @nguniversal/express-engine
npm run build:ssr && npm run serve:ssr
npm install -g pm2
pm2 start dist/<frontend>/server/main.js --name="My Awesome App"
pm2 save && pm2 startup
#Install Certbot
sudo apt-get install python3-certbot-nginx
#install your certificate
sudo certbot --nginx
#Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
2

--

--

Design consultant (UI/UX)

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store