aboutsummaryrefslogtreecommitdiff
path: root/src/requests.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/requests.ts')
-rw-r--r--src/requests.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/requests.ts b/src/requests.ts
new file mode 100644
index 0000000..0242ed5
--- /dev/null
+++ b/src/requests.ts
@@ -0,0 +1,11 @@
+import axios, { AxiosResponse } from 'axios';
+
+const baseUrl = 'https://eugvs.pythonanywhere.com/';
+const baseApiUrl = baseUrl + 'api/';
+
+export const get = (url: string): Promise<AxiosResponse> => axios.get(baseApiUrl + url);
+
+export const del = (url: string): Promise<AxiosResponse> => axios.delete(baseApiUrl + url);
+
+export const post = (url: string, data: object): Promise<AxiosResponse> => axios.post(baseApiUrl + url, data);
+