summaryrefslogtreecommitdiff
path: root/src/clients/api_client.ts
blob: f2bcd355999e0a6721a3d5b5a7aa218f0ffa14b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import axios from "axios";

export class ApiClient {
  readonly url = "http://localhost:5000/api";

  async get(path: string) {
    const request_url = `${ this.url }${ path }`;

    try {
      const response = await axios.get(request_url);
      return response;
    } catch(error) {
      console.log(error);
    }
  }
}