This is the frontend application that serves the disaster donations website. It's a fairly simple node.js (Express) app, serving static HTML. The donations page uses AJAX to call to the backend, running on the same machine, to retrieve and save donations information.
As with the backend, you can run this app locally or deploy it to a VM in a cloud environment. For our example, we will deploy it to an IBM Cloud Hyper Protect Virtual Server instance. With this option, you can ensure that the storage used for this app is encrypted. By running the backend application on the same service then it is secured too.
We've already created the Hyper Protect Virtual server, so now we're ready to run the application.
The application listens both on port 8080
and
8443
. Use the following commands to build your docker container:
cd $HOME/secure-cloud/frontend
docker build -t disaster-frontend .
docker run -d -p8080:8080 -p8443:8443 disaster-frontend
-
Use a web browser to navigate to
your_public_ip:8080
and confirm that the donations homepage loads. -
On the webpage, try out that functionality, driving AJAX calls to issue
GET
andPOST
requests to the backend application. -
If you want to see the information populated in the database, install Robo3T on your local machine.
-
To configure Robo3T, complete the following steps
-
Open Robo3T, select File -> Connect.
-
From the pop-up dialog, select Create.
-
In the connection settings:
-
Under the Authentication tab:
-
Under the SSL tab:
-
-
Highlight your new connection name and click connect.
-
Expand your database and then double-click on transactions.