I’m configuring a nestJS controller and currently using any
type for the request. Is there a type I can use to make this a bit more typesafe?
@Controller('endpoint')
@UsePipes(new MongoSanitizePipe())
export class RequestController {
constructor(private service: Service) {}
@Post('post')
async onAction(
@Body() body: RequestBody,
@Request() request: any,
): Promise<void> {
return this.service.onAction(body, request.headers);
}
}
What did you try and what were you expecting?
I couldn’t find a type for my HttpRequest.
I expect to properly type it.