2022. 12. 22. 16:09ใBackend/NestJS
NestJS๋ Node.js ๋ฐฑ์๋ ์งํ์ Express๊ฐ ํด๊ฒฐํด์ฃผ์ง ๋ชปํ๋ ์ํคํ ์ณ์ ๋ํ ๊ณ ๋ฏผ์ ํด๊ฒฐํ๊ธฐ ์ํด VueJS๋ฅผ ์ฐธ๊ณ ํ์ฌ Express๋ฅผ ๋ํํ ๋ฐฑ์๋ ํ๋ ์์ํฌ์ด๋ค.
๊ทธ๋ ๊ธฐ ๋๋ฌธ์ NestJS์๋ ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ์ฒ๋ฆฌํ๊ธฐ ์ํด ํ๋ ์์ํฌ๊ฐ ์ ๊ณตํ๋ ์ผ๋ จ์ ์๋ช ์ฃผ๊ธฐ๊ฐ ์กด์ฌํ๋ค. ์๋๋ NestJS ๊ณต์๋ฌธ์์์ ์ค๋ช ํ๋ NestJS์ ์์ฒญ ์๋ช ์ฃผ๊ธฐ์ด๋ค.
(์ถ์ฒ: https://docs.nestjs.com/faq/request-lifecycle)
- Incoming request
- Globally bound middleware
- Module bound middleware
- Global guards
- Controller guards
- Route guards
- Global interceptors (pre-controller)
- Controller interceptors (pre-controller)
- Route interceptors (pre-controller)
- Global pipes
- Controller pipes
- Route pipes
- Route parameter pipes
- Controller (method handler)
- Service (if exists)
- Route interceptor (post-request)
- Controller interceptor (post-request)
- Global interceptor (post-request)
- Exception filters (route, then controller, then global)
- Server response
์ด๋ฅผ ๋๋ฆ๋๋ก ์์ถํ๋ฉด ๋ค์์ ์๋ช ์ฃผ๊ธฐ๊ฐ ๋๋ค.
- Request
- Middleware
- Guard
- Interceptor
- Pipe
- Controller
- Interceptor
- Exception Filter
- Response
์ด์ ๋ํด ๊ณต๋ถ๋ ํ๋ ๊น์, ๊ฐ ์๋ช ์ฃผ๊ธฐ์ ๋ํ ๋ด์ฉ๋ค์ ์ ๋ฆฌํ์ฌ ๋ธ๋ก๊ทธ์ ๊ฒ์ํด๋ณผ๊น ํ๋ค.
(๋ธ๋ก๊ทธ ์ฉ์ด๋ฉด ์ค์ค๋ก ์ข ๋ ๊ผผ๊ผผํ๊ณ ๊พธ์คํ ๊ณต๋ถํ์ง ์์๊น.....?)
'Backend > NestJS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
NestJS Request Lifecycle (5) - Exception Filter (0) | 2023.01.13 |
---|---|
NestJS Request Lifecycle (4) - Pipe (0) | 2022.12.29 |
NestJS Request Lifecycle (3) - Interceptor (0) | 2022.12.26 |
NestJS Request Lifecycle (2) - Guard (0) | 2022.12.23 |
NestJS Request Lifecycle (1) - Middleware (0) | 2022.12.22 |