Express to NestJS Controller Migration

Convert an Express route handler to a NestJS controller with decorators.

category:modernization
node
nestjs
migration
backend
0

Prompt

Convert this Express route (or set of routes) to NestJS.

Do:
- Create a @Controller with appropriate @Get/@Post/etc decorators
- Inject services instead of requiring modules directly
- Move validation into DTOs with class-validator
- Use NestJS exception filters instead of manual res.status calls

Return:
- NestJS controller code
- Any new DTOs/services you've introduced.