- In the book "Web development with Node and Express" chapter 21, 22
- A text with hands-on tips about how to configure Node.js and Express.js for production
- A complement to the above text: http://expressjs.com/en/advanced/best-practice-performance.html
- Optional - Another text focusing on the bigger picture of taking code to production.
In the following text and demo videos we will go through how to work with our own private cloud. All student will get a own virtual server to use as a production server for your web application. The severs will be taken down after the examination.
Getting your SSH key and connect to your server
To log into your server you will need a SSH key and connect though SSH. Since the server you will connect to is a Ubuntu server there will be no graphical interface and all the configuration will be done through the terminal. If you running MacOS or Linux you should be able to use the terminal. If you are on Windows you should use the Git-bash program that should have support for SSH.
The first thing you do is to go to the Cloud info page on the course page. You must be logged into CoursePress (use your student account) to se your private link. Download your SSH key pair to your local computer and remember your IP-address. Unzip the keypair-files. You probably have two, one .ppk and one .pem. It is the latest we should use when connecting to the server.
Some Linux resources
If you feel the need of learning more about Linux (commands, tools, bash scripting and so on) there is a learning object available: https://github.com/CS-LNU-Learning-Objects/linux
Installing Node.js on your server
In this video we will install Node.js and npm on a Ubuntu 18.04
Putting a reversed proxy in front of the application
In this video we will install and configure our reversed proxy, nginx
Using a process manager
In this video we will talk about and install the process manager PM2
Adding HTTPS to the server
In this video we will create and install self-signed certificates on our reversed proxy
Getting our code up to the server
In this video we will show ways of putting your code onto the Ubuntu server
Here is the link to the article discussed in the video: https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps