aboutsummaryrefslogtreecommitdiff
path: root/src/requests.ts
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-03-21 17:59:48 +0300
committerGitHub <noreply@github.com>2020-03-21 17:59:48 +0300
commite89a7a79622d25561dc80a8489ae1f6022aebd73 (patch)
treee115938b26ee6019b4c349f52bd98fc34a4575e9 /src/requests.ts
parentfe750a9aadfb451b9537bb3cdd79581ef5120c07 (diff)
parent7f8ab6802c68c46f988ef012fdc88b09e43a9e54 (diff)
downloadchrono-cube-ui-e89a7a79622d25561dc80a8489ae1f6022aebd73.tar.gz
Merge pull request #48 from eug-vs/typescript
Migrate project to Typescript
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);
+