aboutsummaryrefslogtreecommitdiff
path: root/src/requests.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-03-21 14:35:19 +0300
committereug-vs <eug-vs@keemail.me>2020-03-21 14:35:19 +0300
commite32c8be0a4b7f135c01449c3603da347728819a8 (patch)
tree499eeb9d2ab81481e6828f53cc8ab89ed14821f1 /src/requests.ts
parentbfc2a9bc3c1ecbef31e76e36fed79a8500f0d0fd (diff)
downloadchrono-cube-ui-e32c8be0a4b7f135c01449c3603da347728819a8.tar.gz
chore: migrate requests.ts
Diffstat (limited to 'src/requests.ts')
-rw-r--r--src/requests.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/requests.ts b/src/requests.ts
new file mode 100644
index 0000000..eeb2ee7
--- /dev/null
+++ b/src/requests.ts
@@ -0,0 +1,24 @@
+import axios from 'axios'
+
+const baseUrl = 'https://eugvs.pythonanywhere.com/';
+const baseApiUrl = baseUrl + 'api/';
+
+export const get = (url: string) => {
+ return axios.get(
+ baseApiUrl + url,
+ );
+};
+
+export const post = (url: string, data: object) => {
+ return axios.post(
+ baseApiUrl + url,
+ data
+ );
+};
+
+export const del = (url: string, data: object) => {
+ return axios.delete(
+ baseApiUrl + url,
+ data
+ )
+};