In the REST API below, what is the type of file object that is received.   @Post('/:folderId/documents/:fileName') @UseInterceptors(FileInterceptor('file')) @ApiConsumes('multipart/form-data') @ApiImplicitParam({ name: 'fo...
While using NestJS to create API's I was wondering which is the best way to handle errors/exception. I have found two different approaches :   Have individual services and validation pipes throw new Error(), have the controller catch them and tha...
I'm trying to enable usage of socket.io acknowledgement callbacks in Nest.js WebSocketGateways.  I'd like to be able to emit this:  socket.emit('event', 'some data', function (response) { //do something });   And use the messa...
I am a freshman in Nest.js.  And my code as below    @Get('findByFilter/:params')   async findByFilter(@Query() query): Promise<Article[]> {    }   I have used postman to test this router  http://localhost:3000/article/findByFilter/bug?...
The documentation is kinda thin here so I ran into a problem. I try to use Guards to secure Controller or it's Actions, so I gonna ask for the role of authenticated requests (by JWT). In my auth.guard.ts I ask for "request.user" but it...
I'm working on a backend using NestJS, (which is amazing btw). I have a 'standard get a single instance of an entity situation' similar to this example below.  @Controller('user') export class UserController {     constructor(priv...
I want to log the incoming requests and outgoing responses in NestJs. I took information from here Logging request/response in Nest.js and from the docs NestJs Aspect Interception.  It would be awesome to achieve this by not using external packages,...
I am trying to use @nestjs/jwt. Particularly its registerAsync method (my config service loads the configuration asynchronously). I am registering JwtModule in the AuthModule, which then loads specific modules for each login/registration providers. T...
I want to know if there is a decorator that makes the req.user object available in a controller method, if the user is logged in (Authaurization header sent), if not then just let the req.user be null.  The AuthGuard decorator will return 401 if the...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.