Category "nestjs"

NestJS WebSocket

I use angular in the front end where I am learning to use rxjs-websockets. In backend I use nestjs, where i want to learn to use websockets. But every tutorial

NestJS/TypeORM: Cannot set property metadata of #<Repository> which has only a getter

I try to run my nestjstutorial app, the below error is showing. My backend is connected to a PostgreSQL db. TypeError: Cannot set property metadata of # which

How to secure a REST API with an API key

I'm currently creating a Rest API with NestJS (it's really cool by the way). In this API, I'm using JWT (Json Web Token) to allow users to log in and view diffe

Mocking Bull queues in NestJS

I am trying to test that after sending a request to one of my controllers, the queue pushes a job. Implementation itself works as expected. This is my app.modul

Can't pull sqs queue name from .env file in nestjs

When pulling the queue name through .env file I get the following error on the console: Cannot read properties of undefined (reading 'meta'). How can I pass que

Mock grpc service in unit testing nestjs

I want write an unit test for my getAllGroups() method in mail.service.ts: public async getAllGroup(): Promise<{ id: number, name: string }[]> { try {

get Forbidden resource even when the requested user is admin

Middleware is used to protect the resolver. The middleware checks the role of user and despite the right role of the requested user I cannot access listUser que

Why does Repository regenerate In NestJS

Import the module if you want the service to be used by another service. Why do you regenerate the repository instead of exporting it from the module?

Custom Provider: Object literal may only specify known properties, and 'provide' does not exist in type

I'm trying to replace my logger provider in a unit test file with a stubbed provider so that I don't get logs during unit tests from the tested module. I'm gett

Nestjs unit test: TypeError: this.userModel.findById(...).exec is not a function

using nestjs framework and with a repository class that uses mongoose to do the CRUD operations we have a simple users.repository.ts file like this: @Injectable

Postgres TypeORM - FK to PK that is also FK to another table - constraint error

In my NestJS application with postgres db I have these 3 entities: User, Writer, Book and a class named UserBaseEntity. export class UserBaseEntity { @Prim

NestJs Swagger: How to define Api Property for dynamic classes

I have below class export class DocumentsSteps { @ApiProperty({type: ???}) [type: string]: DocumentStep; } How should I define ApiProperty type?

Why are cookies not sent to the server via getServerSideProps in Next.js?

Cookies are not sent to the server via getServerSideProps, here is the code in the front-end: export async function getServerSideProps() { const res = await a

NestJS Testing ConfigService works

I am writing an application to handle requests and return predefined responses to allow testing of external REST endpoints by software that cannot have internal

Post Review on product through Amazon SP-API

Scenario: I'm build a NodeJs (NestJs Framework) application, Where I can get feedback from my clients (Amazon Product Purchaser) and Post its review on my Amazo

Create a custom response in Swagger Nestjs

I have my controller with @Post('email/register') @HttpCode(HttpStatus.CREATED) @ApiOkResponse(AuthConfigSwagger.API_OP_CREATE) @ApiCreatedResponse(Auth

getting response data on logger interceptor

I am trying to log the response data by using logger interceptor, but when I send a new request I get output before undefined after instead of what i expect to

Multiply useQuery on one page, why undefined result?

I need too use useQuery a few times to get different data from db. So I call: const {data: var1} = useQuery(MY_QUERY, {variable: {content1}); const {data: var2

Nest.JS TypeORM "SCRAM-SERVER-FIRST-MESSAGE: client password must be a string"

I dont know why, but since I was cloning my working repository I am using on AWS to a local machine and try to run it, I am getting the following error: "SCRAM-

Disable X-Powered-By in nestjs does not work

I want to disable X-Powered-By in nestjs like the following, but it does not work. main.ts: async function bootstrap() { const logger = new Logger('bootstra