Chapter 1. What is Express?
This chapter covers
- Node.js, a JavaScript platform typically used to run JavaScript on servers
- Express, a framework that sits on top of Node.js’s web server and makes it easier to use
- Middleware and routing, two features of Express
- Request handler functions
Before we talk about Express, we need to talk about Node.js.
For most of its life, the JavaScript programming language has lived inside web browsers. It started as a simple scripting language for modifying small details of web pages but grew into a complex language, with loads of applications and libraries. Many browser vendors like Mozilla and Google began to pump resources into fast JavaScript runtimes, and browsers got much faster JavaScript engines as a result.
In 2009, Node.js came along. Node.js took V8, Google Chrome’s powerful JavaScript engine, out of the browser and enabled it to run on servers. In the browser, developers had no choice but to pick JavaScript. In addition to Ruby, Python, C#, Java, and other languages, developers could now choose JavaScript when developing server-side applications.