How do I deploy my MEAN app?
- In the panel, open My servers and click your server.
- On the Overview tab, wait for the App row to say "MEAN is ready". The page refreshes itself.
- Open the link in the Site address row. If the sample page says
MongoDB: OK, the app is reaching the database.
Folders
/home/app/uygulama/sunucu: the Express app (server.js). The connection string is in the.envfile next to it./home/app/uygulama/istemci: the Angular source. Building it writes to thesunucu/publicfolder.
Changing the code
Connect over SSH and run:
su - app
cd ~/uygulama
After copying your code in, restart the app:
pm2 restart uygulama
The app should listen on port 3000.
MongoDB
MongoDB can only be reached from inside the server. The Login and Password rows in the panel are the admin account. To connect from your computer, use an SSH tunnel.
Your own domain
- Point your domain's A record to your server's IP address.
- As root, replace the old name everywhere:
sed -i 's/OLD_NAME/yourdomain.com/g' /etc/caddy/Caddyfile.OLD_NAMEis the part afterhttps://in the address shown in the panel. - Run
systemctl reload caddy.
Caddy gets and renews the certificate by itself.
Only 80, 443 and 22 for SSH are open to the outside.
No server yet? Order a server with MEAN installed: you choose the size and pay for what you choose.
Thanks for your feedback!