This repository contains code and instructions for a simple but typical "getting started" web app. It is written in Node.js (JavaScript) and uses the Express web framework. An IBM Cloudant NoSQL database serves as backing service to store data displayed by the app. As typical for cloud native /12 twelve factor apps, the sample solution is based on discrete, reusable components which act as microservices to make up the overall app. Both the deployed Node.js program as well as the database can be scaled, improved or even replaced independently. They work together because of how they are configured and by using well-defined APIs.
Thus, the Cloudant database can be configured to work as attached resource with the app versions deployed to Cloud Foundry and Code Engine. This is shown in the architecture diagram below. The solution is kept to these two components for simplicity.
The code is discussed by the following blog post:
Three branches:
- 1cloudfoundry_base holds the Cloud Foundry version of the code. It can only be deployed to Cloud Foundry.
- 2cf_ce_intermediate_hybrid is the branch for a hybrid code version. The code supports deployment to both Cloud Foundry and Code Engine runtime environments. It could be used while running the app in both environments during the transition phase. The app could be enhanced and bugs fixed regardless of the actual runtime environment.
- 3codeengine_target has the code after the migration. It only supports deployment to IBM Cloud Code Engine.