summaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-04-21 18:39:50 -0600
committerHombreLaser <sebastian-440@live.com>2023-04-21 18:39:50 -0600
commit3e94d2245182d3c399585e04e0f5b2de8492e0e9 (patch)
treef72f527573dd7020360957d077057366fe3bd2b4 /src/clients
Commit inicial
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