Tsoa: Redirects

Created on 13 Jun 2018  路  3Comments  路  Source: lukeautry/tsoa

Correct me if I'm wrong, but there doesn't appear to be a way to specify redirects. Are there any plans to add a new decorator for such, or at least provide access to the response object?

Most helpful comment

You can get access to the response like so:

Get()
@SuccessResponse(302, "Redirect")
async myMethod(@Request() request: express.Request) {
  const response = (<any>request).res as express.Response;
  // response.redirect( .. );
}

All 3 comments

You can get access to the response like so:

Get()
@SuccessResponse(302, "Redirect")
async myMethod(@Request() request: express.Request) {
  const response = (<any>request).res as express.Response;
  // response.redirect( .. );
}

@strongpauly does this ^ solve your problem?

Yes it does.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeremyVignelles picture jeremyVignelles  路  3Comments

rustam-crunch picture rustam-crunch  路  5Comments

amcdnl picture amcdnl  路  6Comments

taicho picture taicho  路  5Comments

JimmyBjorklund picture JimmyBjorklund  路  5Comments