最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is the precise order of execution between middleware, guards, interceptors, pipes, filters, etc? - Stack Overf

programmeradmin4浏览0评论

NestJS includes a lot of tools that seem to function as specialized versions of middleware like guards, interceptors, and filters.

What is the order of execution between all of these?

My understanding is that the order of execution goes like this:

Middleware -> Guards -> Interceptors -> Pipes -> Controllers -> Interceptors -> res.on('finish') handlers set up in middleware

NestJS includes a lot of tools that seem to function as specialized versions of middleware like guards, interceptors, and filters.

What is the order of execution between all of these?

My understanding is that the order of execution goes like this:

Middleware -> Guards -> Interceptors -> Pipes -> Controllers -> Interceptors -> res.on('finish') handlers set up in middleware

Share Improve this question edited Dec 11, 2020 at 16:24 Jonathan Hall 79.8k19 gold badges159 silver badges203 bronze badges asked Dec 11, 2020 at 16:21 Greg ThomasGreg Thomas 5676 silver badges17 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

This is mented on in the docs

Your understanding though, is correct, the docs go into a bit more detail when it es to running multiple of each type and how they order at that point. Definitely worth the read.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论