Deploy a MEAN website with Azure VMs

Reading time ~1 minute

MEAN is a development stack for building and hosting web applications. Recall that MEAN is an acronym for its component parts: MongoDB, Express, AngularJS, and Node.js.

In this module, you learned when the MEAN stack is a good choice for web development and when you might want to choose something else. The main reason you might consider MEAN is if you’re familiar with JavaScript.

To see the MEAN stack in action, you created an Ubuntu virtual machine on Azure and installed the MEAN stack on it for web development.

With your MEAN stack in place, you created a basic book inventory web application. To summarize, the web application uses:

  • MongoDB to store information about books.
  • Express to route each HTTP request to the appropriate handler.
  • AngularJS to connect the user interface with the program’s business logic.
  • Node.js to host the server-side application.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
az vm create \
  --resource-group learn-7df5839a-b8e4-44c7-aa07-cf5a0f405ada \
  --name MeanStack \
  --image Canonical:UbuntuServer:16.04-LTS:latest \
  --admin-username azureuser \
  --generate-ssh-keys

az vm open-port \
  --port 80 \
  --resource-group learn-7df5839a-b8e4-44c7-aa07-cf5a0f405ada \
  --name MeanStack

ipaddress=$(az vm show \
  --name MeanStack \
  --resource-group learn-7df5839a-b8e4-44c7-aa07-cf5a0f405ada \
  --show-details \
  --query [publicIps] \
  --output tsv)

ssh azureuser@$ipaddress

Install MongoDB

1
2
3
4
5
6
7
sudo apt-get install -y mongodb

# check the service status
sudo systemctl status mongodb

# verify the installation
mongod --version

Install Node.js

  1. Register the Node.js repository so the package manager can locate the packages, like this.
1
2
3
4
5
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

sudo apt-get install -y nodejs

node -v

Create a basic app

AZ-204: Practice topic 5

1. inboundOutboundBackend2. C### [Page 25](https://www.examtopics.com/exams/microsoft/az-204/view/25/)25. 26. 27. 28. 29. ### [Page 26](h...… Continue reading

AZ-204: Practice topic 4

Published on February 20, 2022

AZ-204: Practice topic 3

Published on February 07, 2022