You’re probably aware that JavaScript is the programming language most often used to add interactivity to the front end of a website, but its capabilities go far beyond that—entire sites can be built on JavaScript, extending it from the front to the back end, seamlessly.
Express.js and Node.js gave JavaScript newfound back-end functionality—allowing developers to build software with JavaScript on the server-side for the first time. Together, they make it possible to build an entire site with JavaScript: You can develop server-side applications with Node.js and then publish those Node.js apps as websites with Express.
Because Node.js itself wasn’t intended to build websites, the Express framework is able to layer in built-in structure and functions needed to actually build a site. It’s a pretty lightweight framework that’s great for giving developers extra, built-in web application features and the Express API without overriding the already robust, feature-packed Node.js platform. In short, Express and Node are changing the way developers build websites.
Express.js Basics
- Server-side web and mobile application framework
- Language: written in JavaScript
- Express builds:
- Single-page, multi-page, and hybrid mobile and web apps
- Common back-end functions for web applications
- APIs (application programming interfaces)
- Templating engines: Express comes with two templating engines, Jade and EJS, which facilitate the flow of data into a website structure.
- MVC pattern: Express supports the Model-View-Controller architecture, a really helpful way to build websites in a model-driven format.
- Platform: Node.js
- Operating system: It’s cross-platform, so it’s not limited to one OS.
- The Express Generator lets you create complex applications quickly.
Express.js and the MEAN stack
Express.js is the “E” in the MEAN software stack, where it runs alongside the MongoDB database, the Node.js environment, and the AngularJS front-end framework.
Every software stack includes an operating system, database, server, and development platform—everything you need to build and run the back end of a website or web application.
Unlike other traditional stacks, the MEAN stack is entirely JavaScript-powered, thanks to Node.js, the JS development environment that gives JavaScript back-end functionality.