liveBook · Manning

Express

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

Express is a Node.js web application framework for building HTTP servers and request-handling routes.

Express is a Node.js framework for building HTTP servers and handling browser requests with less code than the low-level Node.js API. It fits naturally into small microservices, including services that stream video. section 2.6.2 section 2.6

Build a minimal Express server incrementally:

  • Create a Node.js project and install Express with npm install --save express. section 2.6.2
  • Require Express, create an application object, and define a GET route with app.get. section 2.6.3
  • Return content with res.send, then call app.listen to accept requests on port 3000. section 2.6.3
  • Extend the baseline with a /video route that retrieves streaming video for a browser. section 2.6

Minimal server

const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, res) => { res.send('Hello World!'); }); app.listen(port); section 2.6.3

Figure 2.5 Watching the streaming video from our microservice directly in Chrome

Open the browser view showing a streaming video served directly by the microservice at localhost:3000/video. section 2.6

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains installation, minimal routing, responses, and listening, then stops short of broader framework features.
Examples
Uses a Hello World server and a browser-playable video endpoint at /video.
What it assumes
Assumes Node.js project use and npm familiarity while establishing Express installation and server structure step by step.
What you can do after
Build a working Express HTTP server and extend it with request routes such as a video-streaming endpoint.
How it connects
Connects Express with Node.js, npm, HTTP servers, route handlers, microservices, and asynchronous route handlers.

Also explained in

Compare how 4 books explain Express →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.