Skip to content

CloudBytesCollection/serverless-nodejs-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-nodejs-dev

Building Serverless Node.js Apps on AWS

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.

Which project should I use?

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.

Prerequisites

  • Node.js 22+ for installs and CI (nvm use from 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=true locally 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.

Quick start

Chapter 2 starter

nvm use
cd sample-aws-book-api-starter   # required — not the monorepo root
npm ci
npm test
npm start

Then 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.

Book API (main example)

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 start

Environment variables are documented in sample-aws-book-api/README.MD.

Related repos

The Python book in this series uses serverless-python-dev, not this repository.

License

Each subproject includes its own license file (typically BSD 3-Clause). See the folder you are working in.

About

Building Serverless Nodejs Apps on AWS - Companion Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors