Every NestJS Concept Explained
10 concept
application
http server → NestFactory.create()
microservice application → NestFactory.createMicroservice()
standalone application → NestFactory.createApplicationContext()
modules → @Module({})
root module
order (cart,payment)
product
- config
Decorator → fn → Class,Method
Controllers → receive req and return response
@ Controller(““) → root path
@ GET(““) → http verb(get,post,put,delete) → sub root
methods → hello(){} → can add methods to handle incoming req and return res
Provider → class that can be injected in other classes as dependency
- all logic is written here and is used in controllers
req → middlewares → guards → Interceptors → pipes → controller’s route handler → Interceptors → exception filters→ res
flow
- app.module.ts → feature.module.ts → feature.service.ts(provider→actual logic) → feature.controller.ts(return res→endpoint,http req type(get,post,put,delete))