liveBook · Manning

Development mode

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

Development mode is an application execution mode configured for rapid iteration, feedback, and development-oriented tooling.

Development mode configures a microservice for rapid iteration rather than production performance and security. Live reload restarts the service after code changes, shortening the feedback loop. section 2.6.8 section 2.9

Set up development mode with a local project and an npm script:

  • Install nodemon as a development dependency. section 2.6.8
  • Add a start:dev script that runs nodemon against the service entry point. section 2.6.8
  • Run npm run start:dev; reserve npm start for the production-mode command. section 2.6.8

Running a microservice during development

A package configuration can map start:dev to nodemon src/index.js. Running npm run start:dev then watches the service, restarts it after edits, and applies changes without manually stopping and starting the process. section 2.6.8 section 10.5.1

Listing 2.7 Adding a start script for development
{
  "name": "example-3",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "scripts": {
    "start": "node src/index.js",         #1
    "start:dev": "nodemon src/index.js"   #2
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^5.0.0-beta.1"
  },
  "devDependencies": {                    #3
    "nodemon": "^2.0.18"                  #4
  } 
}

Use the package configuration listing to inspect the separate production and development scripts, including nodemon as a development dependency. section 2.6.8

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

How deep it goes
Explains npm scripts, nodemon, live reload, and mode trade-offs without descending into deployment implementation.
Examples
Uses package.json, npm install, npm start, npm run start:dev, and nodemon src/index.js as operational examples.
What it assumes
Assumes a local Node.js project, npm, an editable service, and required environment variables or service dependencies.
What you can do after
Operate a Node.js microservice locally with live reload through a named npm start:dev script.
How it connects
Connects development mode with npm scripts, nodemon, live reload, production mode, environment variables, and microservices.

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.