npm proxy
$ npm config get proxy
http://127.0.0.1:25378/
如果你的npm设置了如上代理,那么当请求本地服务时,应该会出现代理错误(通常是502响应):
import { HttpService } from '@nestjs/axios';
@Injectable()
export class ForwardService {
@Inject()
private readonly http: HttpService;
...
await this.http.request(...).toPromise(); // AxiosError: 502
}
标签:npm,axios,http,nestjs,config,proxy
From: https://www.cnblogs.com/develon/p/17440655.html