routing-controllers
routing-controllers copied to clipboard
redirect not working with interceptor
redirect not working with interceptor class:
Interceptor class:
@Interceptor()
export class Json implements InterceptorInterface {
intercept(action: Action, content: any) {
const { statusCode } = action.response;
return {
httpCode: statusCode,
message: 'ok',
payload: content,
}
}
};
@Get('/github')
@Redirect('http://github.com/:owner/:repo')
getUsers() {
return {
owner: 'pleerock',
repo: 'routing-controllers',
}
}
getting error:
Could not find url parameter owner in passed options object