From 3e94d2245182d3c399585e04e0f5b2de8492e0e9 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Fri, 21 Apr 2023 18:39:50 -0600 Subject: Commit inicial --- src/clients/api_client.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/clients/api_client.ts (limited to 'src/clients') 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 -- cgit v1.2.3