MEAN Cloud and Mobile, Local Deployment and Installing Node.js, npm, and MongoDB in Angular
Categories: Angular Angular JS
MEAN Cloud and Mobile, Local Deployment and Installing Node.js, npm, and MongoDB in Angular
This chapter will cover both the cloud deployment of our blog application and a short discussion on building a mobile HTML5 version of our application. The cloud deployment will be to a free account on RedHat’s OpenShift platform. The mobile discussion will cover the steps needed to build a mobile version of the blog application that will run on any mobile device and can be distributed through the respective mobile application stores.
The mobile version will use the same REST services that we use for the cloud version of our blog application.
Local Deployment
Before we deploy our blog application to the cloud, we will set up a local project in NetBeans that we will later use to deploy our blog to OpenShift. We can also run and test our blog application locally before pushing it to the cloud. All the code for this chapter has already been written and can be downloaded from GitHub. We will walk through the code and discuss the changes that have been made to our AngularJS application to allow for a deployment to the cloud.
Our cloud deployment uses Node.js as the server platform, ExpressJS as the web application framework, and MongoDB as the database. We will discuss how AngularJS integrates with all three of these to form a MEAN (MongoDB, ExpressJS, AngularJS, and Node.js) stack deployment. We will primarily focus on the role that AngularJS plays in a MEAN stack application.
We will not cover the Node.js code in great detail. Although the Node.js server-side code is JavaScript, it can often be quite complex. If you have server-side experience, feel free to experiment with the server code. Books written specifically on the MEAN stack will cover the Node.js and ExpressJS code of MEAN stack applications in much greater depth than we will here.
Installing Node.js, npm, and MongoDB
Before you can run the new MEAN blog application locally, you must install Node.js, MongoDB, and npm (the Node.js package manager) on your local system. The installations are different for each operating system, but you can find more information about Node.js at nodejs.org and you can find information about MongoDB at http://www.mongodb.org. If you are using one of the Linux distributions, you can usually install and configure both Node.js and MongoDB through the OS package management system. Before we continue, install and configure Node.js, npm, and MongoDB if you haven’t done so already.