summaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/api_client.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/clients/api_client.ts b/src/clients/api_client.ts
new file mode 100644
index 0000000..f2bcd35
--- /dev/null
+++ b/src/clients/api_client.ts
@@ -0,0 +1,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);
+ }
+ }
+} \ No newline at end of file