Category "nestjs"

NestJS copy assets files

I'm working on an EmailModule that reads a pug template. I couldn't get the build to include the *.pug templates file: I have followed the instruction based o

TypeORM OneToMany causes "ReferenceError: Cannot access '<Entity>' before initialization"

I have two entities: User and Habit. A user can create multiple Habits, thus I use a OneToMany relation on the User (and ManyToOne on the Habit, respectively).

Define rules for the access control using CASL

I read the article from link and understand there are 3 ways to define abilities. But I have no clue to combine them together. For example, In the three struct

How to implement clinic.js in Nest JS Framework (typescript)

I implemented Clinic.js in Node JS. But I don't know how to implement clinic.js in Nest JS Framework. I explore it how to implement clinic.js to Nest JS. But I

NestJS enable cors in production

I've enabled CORS in my NestJS app following the official tutorial, so my main.ts looks like the following: import { FastifyAdapter, NestFactory } from '@nestj

How to add summary and body manually in swagger nestjs

I am trying to add summary in my swagger documentation routes but I am not able to find the appropriate decorator for defining the summary. There are some rout

Why kafka write null data to the database?

I am working on a nestjs project. My project gets data from Kafka's topic and writes the data to the database (mysql). If I read hundreds of messages from Kafka

How to inject service to validator constraint interface in nestjs using class-validator?

I'm trying to inject my users service into my validator constraint interface but it doesn't seem to work: import { ValidatorConstraintInterface, ValidatorConst

NestJS tcp microservice load balance

I have a nestjs app as follows: Gateway - HTTP Microservice1 - TCP (ms1) Microservice2 - TCP (ms2) Gateway calling ms1 and ms2. ms1 and ms2 are the same duplica

NestJS GRPC metadata no longer received by server after @grpc/grpc-js update

The package grpc is being depreciated so i have moved to @grpc/grpc-js as advised by the maintainers. Since moving to the new package NestJs no longer receives

How to resolve a circular dependency in nest js?

I have my app.module that imports UserModule and AuthModule. @Module({ imports: [UserModule, AuthModule], controllers: [AppController], providers: [AppSer

How to save a nested object using typeorm and Nestjs?

I have the following Data entity: @PrimaryGeneratedColumn() id: number @Column() dataA: string @Column() dataB: string @Column() dataC: number @Colum

Nestjs and Google Recaptcha

I am trying to implement a server-side validation for reCaptcha using Nestjs and I want to if I should implement this as a module or as a service for modules(su

Intercepting in Multer Mutates Request? (NestJS)

Does multer mutates any request that has given to it? I'm currently trying to intercept the request to add this in logs. But whenever I try to execute this code

NestJs: Failed to execute command: npm install --silent

After I installed Nest globally, I tried creating a new project but I got this error Failed to execute command: npm install --silent. nest new new_project

EROFS: read-only file system, mkdir '/logs/'

When I try running local server from npm run start, it shows this error. I'm using Mac and NestJS.

How to implement Node-Media-Server in Nestjs?

I try to implement a RMTP server in Nestjs thanks to Node-Media-Server, have any of you ever managed to do something like this? I naively tried to run this litt

How can I set a session key from inside a GraphQL resolver in NestJS?

I'm discovering Nest.js and I want to setup a cookie based authentication system with GraphQL. I already installed express-session middleware, here is the conf

nest Command not found

I followed the documentation to create my first NestJS project. Installing the Nest CLI with the command npm i -g @nestjs/cli was successful. The output was:

Nest.js axios HttpModule freezes app initialization

I have a module that goes like this: import { Module } from '@nestjs/common' import { OtpService } from '@modules/auth/otp/otp.service' import { OtpResolver } f