Ficool

Chapter 4 - Nestjs day 1

1. NestJS Learning Notes Basic Setup & CLI Commands Installation: npm i -g @nestjs/cli (corrected from @nestjs/core)

2. Create new module: nest g module name Create new controller: nest g controller name

3. Create new service: nest g service name Core Concepts Controllers Define routes and handle HTTP requests Use decorators like @Get(), @Post(), @Put(), @Delete() Modules Organize the application structure Declare what controllers and services are being used Connect different parts of the application Services Contain business logic and functions Injectable classes that can be used across the application Decorated with @Injectable() Route Handling Route Parameters

function(@Param('id') id: string)

(corrected: no colon in @Param)

Request Body (POST requests)

function(@Body() body)

(corrected: no comma needed)

More Chapters