aboutsummaryrefslogtreecommitdiff
path: root/src/requests.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/requests.js')
-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
+ );
+};