feat: basic api
This commit is contained in:
17
client/src/app/services/api.ts
Normal file
17
client/src/app/services/api.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Transaction } from '@shared/interfaces/transaction'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class APIService {
|
||||
private apiUrl = 'http://localhost:3000/api'
|
||||
|
||||
constructor(private http: HttpClient){}
|
||||
|
||||
getTransactions(): Observable<Transaction[]>{
|
||||
return this.http.get<Transaction[]>(this.apiUrl + '/transactions');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user