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

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

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

    try {
      const response = await axios.get(request_url);

      return response;
    } catch(error) {
      return error.response;
    }
  }
}