@Injectable()
export class ReverseProxyMiddleware implements NestMiddleware {
...
constructor() {
this.proxy = createProxyMiddleware({
target: configs.users.target,
changeOrigin: true
});
}
use(req: Request, res: Response, next: () => void) {
this.proxy(req, res, next);
}
}