Skip to content

Instantly share code, notes, and snippets.

@job25721
Created January 21, 2022 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save job25721/0336587f1e0cfbbe49f1784ceb065096 to your computer and use it in GitHub Desktop.
Save job25721/0336587f1e0cfbbe49f1784ceb065096 to your computer and use it in GitHub Desktop.
import { Injectable } from '@nestjs/common';
import axios from 'axios';
import { User } from 'src/user/user.schema';
@Injectable()
export class JsonPlaceholderService {
private serviceUrl = 'https://jsonplaceholder.typicode.com';
getUsers() {
return axios.get<User[]>(`${this.serviceUrl}/users`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment