小编Kri*_*909的帖子

模块“rxjs”没有导出成员“firstValueFrom”

App.service 文件如下所示:

import { Injectable } from '@nestjs/common';
import { HttpService } from '@nestjs/axios';
import { Observable, firstValueFrom } from 'rxjs';
// import { firstValueFrom } from 'rxjs';

@Injectable()
export class AppService {
  constructor(private httpService: HttpService) {}
  async getWeatherForecasts() {
    const url =
      'http://www.7timer.info/bin/api.pl?lon=113.17&lat=23.09&product=astro&output=json';
    const { data } = await firstValueFrom(this.httpService.get(url));
    return data;
  }
}
Run Code Online (Sandbox Code Playgroud)

Package.json 文件如下所示:

  "dependencies": {
    "@fmr-pr103625/nest-scaffold": "^1.5.5",
    "@nestjs/apollo": "^10.0.9",
    "@nestjs/axios": "0.0.7",
    "@nestjs/common": "^7.6.18",
    "@nestjs/core": "^7.6.18",
    "@nestjs/graphql": "^10.0.9",
    "@nestjs/platform-express": "^7.6.18",
    "apollo-server-express": "^3.6.7",
    "axios": "^0.27.2",
    "graphql": "^16.3.0",
    "graphql-tools": …
Run Code Online (Sandbox Code Playgroud)

node.js rxjs angularjs nestjs

7
推荐指数
1
解决办法
8858
查看次数

如何在 Express 中启用信任代理。Nestjs应用程序

我正在学习nestjs,并构建一个应用程序,但我的ip位于代理后面,

Nestjs 文档说启用快速信任代理,

https://docs.nestjs.com/security/rate-limiting

我在如何做到这一点以及如何找到 IP 方面遇到了麻烦。

ip proxy nestjs

2
推荐指数
1
解决办法
4705
查看次数

标签 统计

nestjs ×2

angularjs ×1

ip ×1

node.js ×1

proxy ×1

rxjs ×1