Use Cloud Foundry the MEAN Way

5 min read

Our updated tutorial shows you how to use MongoDB on IBM Cloud

As a developer, you probably have heard about the MEAN stack. It is the combination of MongoDB, the Express web framework, Angular, and Node.js. Our solution tutorial on building a modern web application using MEAN stack has covered that topic for some time. The tutorial has now been updated to feature the new IBM Cloud Databases for MongoDB service. Read on to learn about the tutorial and database security.


Running MEAN on Cloud Foundry

The tutorial guides the user through the steps of provisioning a MongoDB service and deploying a Node.js application to Cloud Foundry. IBM Cloud provides both the classic, public Cloud Foundry environment as well as isolated, enterprise-grade Cloud Foundry Enterprise Environment (CFEE). Cloud Foundry makes it simple to the developer to deploy (push) the application and to automatically bind services like the MongoDB service to the app. Avoiding having to manually configure and copy credentials adds to the ease of use and application security.

The application code extracts the database connection information like the user name, password, and the SSL certificate out of the Cloud Foundry runtime environment. The app needs the certificate because IBM Cloud Databases for MongoDB enforces secure database connections and only allows access encrypted by TLS/SSL. The code on GitHub shows how to extract and apply the SSL certificate.

IBM Cloud Databases for MongoDB integrates with the Key Protect service so that you can manage your own keys for storage encryption. Moreover, the database service also leverages identity and access management (IAM) and activity tracking integrations for enhanced security and allows deployment to private network endpoints.

Skeleton MEAN app

The updated tutorial and code support local development of the app code, either with an installed Node.js environment or with the provided Dockerfile using Docker.

Get started today

It is easy to get started writing Node.js apps—build them with popular web frameworks and deploy them to IBM Cloud. One of the provided compute options is Cloud Foundry—either public or the isolated enterprise version CFEE. Just follow the updated solution tutorial on deploying a modern web application using MEAN stack.

If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.

Be the first to hear about news, product updates, and innovation from IBM Cloud