NOTE
We could probably write a similar section for nearly every HTTP server
listed in Chapter 27, “Other HTTP Servers.” If someone wants to install an
LLMP stack (Linux, lighttpd, MySQL, PHP), for example, it is certainly
possible.
MEAN
As the web moved forward with more and more dynamic websites and
applications, it became vital for web developers to know JavaScript. Then
someone had the idea of writing applications that could run both on the client
and server sides in the same language. The foundational reasoning for doing
this was speed. It takes time to develop for the web. If you use multiple
programming languages, you have to either learn multiple languages or hire
people who know the languages you use. Further, as more and more websites
have become fully interactive experiences, learning JavaScript is already a
necessity for more developers. Therefore, JavaScript is now the language of
choice for both the client and server sides—and it is an important component
in the MEAN web stack.
You do not have to be running Linux to serve content with MEAN. You can
also run a MEAN stack on Windows or on macOS. In addition, everything for
this stack is written in JavaScript. The database used is one of the NoSQL
options, MongoDB, which works very well with the JSON data format used
in a MEAN stack.
A MEAN stack consists of four main components, regardless of the operating
system being used as a platform:
MongoDB—One of the NoSQL databases discussed in Chapter 29,
“NoSQL Databases,” MongoDB is used to store data in JSON format for
an application.
Express.js—This back-end web application framework runs on Node.js.
AngularJS or Angular—These are both JavaScript MVC (model–view–
controller) frameworks. Angular is newer and is a complete rewrite of
AngularJS, with some intentional changes along the way. Angular
provides the front-end web application framework that allows you to run
code in a user’s browser.
Node.js—Node.js is an execution environment for event-driven server-
side applications.
Regardless of your operating system, most MEAN stack users recommend