Category "nestjs"

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

Vendor Machine API's Postman Collection Issue

I am trying to create a postman collection for a Vendor machine API but when I try to send a login request localhost:3000/auth/login I get connect ECONNREFUSED

How to have class-transform converting properly the _id of a mongoDb class?

I've the following mongoDb class: @Schema() export class Poker { @Transform(({ value }) => value.toString()) _id: ObjectId; @Prop() title: string;

Mongoose Subdocuments in Nest.js

I'm moving my app from express.js to Nest.js, and I can't find a way to reference one mongoose Schema in another, without using old way of declaring Schema with

Access raw body of Stripe webhook in Nest.js

I need to access the raw body of the webhook request from Stripe in my Nest.js application. Following this example, I added the below to the module which has a

How to use nestjs Logging service

I tried to use the internal Logger of nestjs (described on https://docs.nestjs.com/techniques/logger -> but with no description of how to use it) But I had

Cannot upload more than 5 attachments with GraphQL mutation

I am trying to attach more than 5 files with GraphQL mutation in NestJS API server. It works when the number of attachments is either 5 or less. I cannot find a

"Cannot use import statement outside a module" in typeorm migration when run nestjs app

I have created the nestjs app. In the root app folder I have these subfolders: dist migration src test The migration folder contains typeorm migrations. When r

CORS is somehow stopping my Angular and Nestjs apps from communicating

I'm building an app with Angular and NestJS using NGXS for state management. I got everything set up and served my application and got this error in the consol

How to get user JWT token in JWTStrategy (NestJS)?

My problem is that I want to check if the login token is invalidated in the database (after changing password). However, the validate function in JWTStrategy on

Postgres OVERLAPS date function in TypeORM

I want to transfer the query to TypeORM. It looks like this in Postgres SELECT * from equipment_charging where (equipment_charging."start_date"::date, equipme

How can I unit test that a guard is applied on a controller in NestJS?

I've got a controller configured in NestJS and I want to check that the appropriate guards are set - does anyone have an example of how it could be done? This

Nestjs Mongodb always return empty array

I am trying to create a simple nestjs project that connects to mongodb. I followed the official documentation of nestjs, but connected to my own db with "user"

How to enable NestJs swagger 4.x plugin

How do you use the new swagger plugin? I have it in my compiler options: "compilerOptions": { "plugins": ["@nestjs/swagger/plugin"] } And I am runni

How to apply Global Pipes during e2e tests

How do you apply global pipes when using Test.createTestingModule? Normally, global pipes are added when the application is mounted in main.ts. beforeEach(asy

NestJS and Serverless - handler 'handler' is not a function

I am trying to implement NestJS as a AWS Serverless function using serverless-framework. I was following this official documentation and my code is exactly as i

NestJS: How to retry when Kafka consumer fails?

There might be a situation where even though the message is received from Kafka, but due to some reason (Database is down, webhook is offline or ...) still the

Is there anyway to get types interfaces for request, response in Nest.js with Fastify

I am learing Nest.js and on the beging of documentation I read that I can use it not only with express but also with fastify so I setuped up my first project wi

TypeORM problem saving entity with cascade true

I m using NestJS with TypeORM and I m trying to save a user conversation with messages. I set the messages field on the conversation entity to cascade: true. Bu