Companion code for Building Serverless Node.js Apps on AWS (Cloud Bytes Collection). Clone this repo and open the project that matches the chapter you are on.
This repo is a monorepo: each sample app has its own package.json and package-lock.json. Run npm ci and npm start inside the project folder, not at this root.
| Folder | When to use it |
|---|---|
| sample-aws-book-api-starter | Chapter 2 — Serverless hello-world, Jest, serverless-offline |
| sample-aws-book-api | Chapters 3–10 — Book API (MongoDB, SNS, Bedrock, tests, CI/CD) |
Each folder has its own README with environment variables, Docker notes, and deploy steps.
- Node.js 22+ for installs and CI (
nvm usefrom this directory reads.nvmrc) - Docker (MongoDB; optional LocalStack for Chapter 5 SNS)
- AWS CLI configured when you deploy (
serverless deploy) - Amazon Bedrock model access in your account for Chapter 9 (
SKIP_BEDROCK=truelocally until deploy)
Both samples pin Serverless 3.40 with npm overrides for patched transitive deps (tar, uuid, file-type). See each project README for audit and deprecation notes.
nvm use
cd sample-aws-book-api-starter # required — not the monorepo root
npm ci
npm test
npm startThen open http://localhost:3000/dev/sample/path/hello (expect {"response":"Hello!"}).
See sample-aws-book-api-starter/README.MD for deploy and AWS credential notes.
nvm use
cd sample-aws-book-api # required — this monorepo folder is the only Book API copy
npm ci
cp .env.example .env
docker compose up -d mongo localstack # optional LocalStack for Ch. 5 SNS
npm run localstack:setup # copy printed vars into .env
# Ch. 9 Bedrock: SKIP_BEDROCK=true in .env for local; false after deploy
npm test
npm startEnvironment variables are documented in sample-aws-book-api/README.MD.
The Python book in this series uses serverless-python-dev, not this repository.
Each subproject includes its own license file (typically BSD 3-Clause). See the folder you are working in.
