A NestJS API running on AWS Lambda via the Serverless Framework, with CRUD endpoints for:
AuthorBook
- Lambda entrypoint:
src/lambda.ts - Root module:
src/app.module.ts - Modules:
src/modules/author/*src/modules/book/*
- Entities:
src/entity/author.entity.tssrc/entity/book.entity.ts
- DB config:
src/config/database.ts - Serverless config:
serverless.yml
- NestJS + TypeORM migrated to a modern stack:
- NestJS 11
- TypeORM 0.3
mysql2driver
- Removed
@nestjsx/crud; introduced explicit CRUD controllers and services. - Migrated from
tslintto ESLint (flat config). - Added a health endpoint:
GET /health(in serverless-offline:GET /local/health)
- Fixed Lambda bootstrap/caching logic.
- Updated
serverless.ymltonodejs20.xruntime and proxy routing. - Added and fixed e2e tests for
bookandauthorCRUD flows.
npm run build✅npm run lint✅npm test✅npm run test:e2e✅npm run sls:offline+ smoke (/local/health,/local/api/book) ✅
npm install
npm run sls:offlineServerless Offline endpoints are stage-prefixed:
http://localhost:3000/local/healthhttp://localhost:3000/local/api/bookhttp://localhost:3000/local/api/author
The current combination is selected because it works end-to-end. Next wave toward absolute latest:
- Serverless 4 migration
- move
serverless+serverless-offlineto 4.x/14.x - handle mandatory authentication/license flow in CI/CD and local environments
- move
- TypeScript track
- stay on TS 6.x and continuously monitor TS 7 breaking changes
- Security hardening
- systematically reduce high vulnerabilities via transitive updates and lockfile refresh
- DB migrations
- replace
synchronize: truewith proper TypeORM migrations for production
- replace
- CI pipeline
- add a pipeline that runs
build/lint/test/e2eand optionalsls package
- add a pipeline that runs