This simple demo has an error https://docs.nestjs.com/techniques/http-module
import { Get, Controller, HttpService } fro
You have to make sure to handle your responses as a JSON you can return it as a promise and get the data, use one of both or HttpService or axios
import { Get, Controller, HttpService } from '@nestjs/common';
@Controller()
export class AppController {
constructor(private readonly http: HttpService) {}
@Get()
root(): {
return this.httpClient.get('https://api.github.com/users/quen2404')
.toPromise()
.then(res => res.data)
.catch(err => /*handle error*/)
}
}