Nest: Pipes for ws and rpc calls

Created on 14 Jun 2017  路  5Comments  路  Source: nestjs/nest

Same case as for http - validate input params )

type

Most helpful comment

hi @artaommahe,
it'd be possible since the nearest release - you would be able to use pipes, filters and guards also (new feature).

All 5 comments

hey @artaommahe ,
what if pipe throws an exception in ws case? just generic response?

@kamilmysliwiec yep, but response format is good question ) I dont know if there is some best practice for ws response format. In my projects i use this one

interface IWsSuccessResponse {
  status: 'ok';
  result: Object | Array | null;
}
interface IWsErrorResponse {
  status: 'error';
  result: { message: string };
}

hi @artaommahe,
it'd be possible since the nearest release - you would be able to use pipes, filters and guards also (new feature).

Hi @artaommahe,
The v4 is published now. Enjoy! :cat:

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yanshuf0 picture yanshuf0  路  3Comments

menme95 picture menme95  路  3Comments

KamGor picture KamGor  路  3Comments

breitsmiley picture breitsmiley  路  3Comments

VRspace4 picture VRspace4  路  3Comments