aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEug-VS <eug-vs@keemail.me>2020-01-02 13:05:18 +0300
committerEug-VS <eug-vs@keemail.me>2020-01-02 13:09:46 +0300
commitbbcc4214d3064d58cf59265db2da326c629232ff (patch)
tree018f2da640f2658feceee2b506c55743832d2a52 /src
parent800992d6322897acb5829ee40728bc5adee455e5 (diff)
downloadchrono-cube-ui-bbcc4214d3064d58cf59265db2da326c629232ff.tar.gz
Create functions for GET and POST requests
Diffstat (limited to 'src')
-rw-r--r--src/requests.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/requests.js b/src/requests.js
new file mode 100644
index 0000000..91eaf65
--- /dev/null
+++ b/src/requests.js
@@ -0,0 +1,17 @@
+import axios from 'axios'
+
+const baseUrl = 'http://localhost:8000/';
+const baseApiUrl = baseUrl + 'api/';
+
+export const get = (url) => {
+ return axios.get(
+ baseApiUrl + url,
+ );
+};
+
+export const post = (url, data) => {
+ return axios.post(
+ baseApiUrl + url,
+ data
+ );
+};