Skip to content
Advertisement

Tag: nestjs

What is the –watch and –debug option in nest start

I read following documentation described nest command. https://docs.nestjs.com/cli/scripts According to the document, following must be added to package.json What are the –watch and –debug options? Answer In general, –watch means the terminal will stay open and watch for any file changes and then reload the server. –debug means it will log more messages to the console (e.g. info or warnings),

NestJS controller not mapped

So I have an API that will be deployed in a docker container. This API has the authentications controller, simple and not something special. When I start up the API in development mode on my local machine, the auth controller will be found and everything is working fine. Same for building and running it on my local machine. But when

NestJs transform GRPC exception to HTTP exception

I have a HTTP server that connects to a gateway over GRPC. the gateway also connects to other . GRPC microservices. the flow looks like this: Client -> HttpServer -> GRPC server (gateway) -> GRPC microservice server X The way i handle errors currently is like so (please let me know if there is better practice) i will only show

Nest can’t resolve dependencies of the UserModel (?)

When I try to use MongooseModel on Users I am getting the following error Nest can’t resolve dependencies of the UserModel (?). Please make sure that the argument DatabaseConnection at index [0] is available in the MongooseModule context. /src/database/database.module.ts /src/database/database.provider.ts /src/app.module.ts /src/auth/auth.module.ts /src/users/user.module.ts Answer Instead of configuring mongoose statically in your database.provider.ts, you should use the MongooseModule.forRootAsync import:

extend existing API with custom endpoints

I’m creating an API for multiple customers. The core endpoints like /users are used by every customer but some endpoints rely on individual customization. So it might be that User A wants a special endpoint /groups and no other customer will have that feature. Just as a sidenote, each customer would also use his own database schema because of those

NestJS Global Modules in tests

Is there a way to automatically provide all @Globalmodules into a TestModule ? (i.e without having to import them, the same way the main application works) So far, I had to make sure to insert any global modules into the import list of my call: Answer Global modules always have to be imported once for their providers to be available

Advertisement