[glm-grade=A-] refactor: extract /api/v1/version into routes/version.js + npm ci build

Companion to ff92706 (drift test fix). The inline handler moves to a
module exporting { buildRouter, getVersion, getName }, pre-built once
at startup and mounted bare on apiRouter — the exact shape the drift
test walker now recognizes. Dockerfile builder stage switches to
npm ci --omit=dev for deterministic builds. Tests: 12/12 across the
three new/updated suites; full suite 1837/1837.
This commit is contained in:
Krystie
2026-08-15 00:01:16 -07:00
parent 86cc21c7a4
commit bd40fb1c17
5 changed files with 142 additions and 19 deletions
+3 -2
View File
@@ -1,10 +1,10 @@
# ── Build stage: install all deps (including devDeps for build tooling) ──────
# ── Dependency stage: deterministic production-only install ────────────────
FROM node:20.11.1-alpine3.19 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
RUN npm ci --omit=dev
# ── Production stage: only production deps + source ──────────────────────────
FROM node:20.11.1-alpine3.19
@@ -22,6 +22,7 @@ COPY *.js ./
COPY src/ ./src/
COPY routes/ ./routes/
COPY openapi.yaml ./
COPY package.json ./
# VERSION file holds the short git SHA the image was built from.
COPY VERSION ./