https://github.com/codewithalihamza/interceptor-in-nestjs
https://github.com/codewithalihamza/interceptor-in-nestjs
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codewithalihamza/interceptor-in-nestjs
- Owner: codewithalihamza
- Created: 2025-02-20T18:11:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-20T19:11:09.000Z (over 1 year ago)
- Last Synced: 2025-02-20T19:40:22.920Z (over 1 year ago)
- Language: TypeScript
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#
Interceptors in Nest Js.
## Description
NestJS, a powerful Node.js framework, provides various features to enhance the development of scalable applications. One of these key features is Interceptors, which allow developers to manipulate incoming requests and outgoing responses. This repo explores interceptors use cases, and how to implement them in a NestJS application.
Understanding Interceptors
Interceptors in NestJS act as middleware but offer more control over request-response handling. They provide a way to:
- Modify request data before reaching the controller.
- Transform response data before sending it to the client.
- Log or track request/response execution time.
- Implement global error handling.
- Apply caching mechanisms.
Interceptors are executed before and after the route handler, making them useful for cross-cutting concerns like logging, response transformation, and performance monitoring.
## Installation
```bash
$ yarn install
```
## Running the app
```bash
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
```
## Test
```bash
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
```
## 💫 About Me:
I'm Ali Hamza from Pakistan 🇵🇰, an experienced Full Stack Developer. With a comprehensive understanding of both front-end and back-end technologies, I am dedicated to creating strong and reliable software applications that perform well and meet the needs of the users effectively. 💻🚀
## 💻 Tech Stack:
              
## Stay in touch
- Linkedin - [@syedalihamzaofficial](https://www.linkedin.com/in/syedalihamzaofficial/)
- Website - [Ali Hamza](https://syedalihamzaofficial.blogspot.com/)
- Medium - [@syedalihamzaofficial](https://medium.com/@syedalihamzaofficial)
- YouTube - [@TechnicalHamzaOfficial1](https://www.youtube.com/@TechnicalHamzaOfficial1)