Last active
January 7, 2021 15:06
-
-
Save nishabe/9f5d4fcd23bdadb04b5ede4509500a14 to your computer and use it in GitHub Desktop.
api.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpService, Injectable } from '@nestjs/common'; | |
import { Student } from '../student/student.service'; | |
@Injectable() | |
export class ApiService { | |
constructor(private http: HttpService) {} | |
async getStudent(firstName: string, lastName: string): Promise<Student> { | |
const url = `../get-student?firstName=${firstName}&lastName=${lastName}`; | |
const response = await this.http.get(url).toPromise(); | |
return response.data; | |
} | |
getHello(): string { | |
return 'Hello World!'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment