liveBook · Manning

Node.js

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

Node.js is an open-source JavaScript runtime built on Chrome's V8 engine for executing JavaScript outside a web browser.

Node.js runs JavaScript microservices outside the browser. It is well suited to small, network-oriented services, and a basic HTTP server takes little code to start. It is a practical stack choice, not a requirement of microservices: services can use other languages. section 2.3 section 2.0

To build and check one service locally:

  • Install Node.js, then check `node --version` and `npm --version`. npm comes with Node.js and installs third-party packages. Keep development and production Node.js versions aligned. section 2.5.4
  • Create a Node.js project, install Express, and add an HTTP GET handler. Run a single service directly on Linux, Windows, or macOS; use Docker when developing and testing multiple services together. section 2.6 section 2.5

Run the first server

From the project directory, run `node src/index.js`. Node.js executes that file and starts the HTTP server. Open `http://localhost:3000` to check for “Hello World”; press Ctrl-C in the terminal to stop it. The next step adds a `/video` route that streams a sample video to the browser. section 2.6.4 section 2.6

Keep direct Node.js execution available even in a larger application: isolating one service helps with development, testing, and troubleshooting. For a faster development loop, nodemon provides live reload; environment variables configure services for development and production. section 2.5 section 2.9

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

How deep it goes
Builds and runs a first HTTP service step by step, while deferring fuller Node.js coverage.
Examples
Uses a local Hello World server and an HTTP video-streaming route as runnable examples.
What it assumes
Introduces Node.js installation and a first service without attempting to teach JavaScript or Node.js in full.
What you can do after
Build it from scratch: create and run a single JavaScript HTTP microservice, then check its response in a browser.
How it connects
Connects Node.js to JavaScript, Express.js, npm, Docker Compose, and environment variables.

Also explained in

Compare how 4 books explain Node.js →

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.