liveBook · Manning

Server

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

An HTTP server is software that listens for HTTP requests and returns HTTP responses.

An HTTP server is software that listens for HTTP requests and returns responses. A minimal Node.js service can expose a route, send text, and listen on a port. section 2.6.3 section 2.6.4

Build a minimal server incrementally:

  • Create a Node.js project and install Express. section 2.6
  • Create an entry point such as src/index.js and instantiate the Express application. section 2.6.3
  • Register an HTTP GET route that sends a response. section 2.6.3
  • Call listen with a port, then run the script with Node.js. section 2.6.3 section 2.6.4
  • Open the local address in a browser and stop the process with Ctrl-C. section 2.6.4

Streaming video service

A first microservice can serve video through a GET /video route, allowing a browser to watch the stream at http://localhost:3000/video. section 2.6

Listing 2.3 A minimal Express web server
const express = require('express');    #1
 
const app = express();                 #2
 
const port = 3000;                     #3
 
app.get('/', (req, res) => {           #4
  res.send('Hello World!');            #5
}); 
 
app.listen(port);                      #6

Use the minimal Express listing as a copyable baseline for defining a route, sending a response, and starting the server. section 2.6.3

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

How deep it goes
Builds a runnable Express server with one route and local testing, while skimming broader Node.js and production concerns.
Examples
Uses Hello World, localhost:3000, and browser-based video playback through /video.
What it assumes
Assumes a Node.js project and basic command-line use, while teaching the server structure from minimal boilerplate.
What you can do after
Build it from scratch with Node.js and Express, run it from a terminal, and validate it in a browser.
How it connects
Connects HTTP requests and responses with Node.js, Express, HTTP GET routes, microservices, and video streaming.

Also explained in

Compare how 11 books explain server →

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.