diff options
author | Eug-VS <eug-vs@keemail.me> | 2020-01-02 13:05:18 +0300 |
---|---|---|
committer | Eug-VS <eug-vs@keemail.me> | 2020-01-02 13:09:46 +0300 |
commit | bbcc4214d3064d58cf59265db2da326c629232ff (patch) | |
tree | 018f2da640f2658feceee2b506c55743832d2a52 /src/requests.js | |
parent | 800992d6322897acb5829ee40728bc5adee455e5 (diff) | |
download | chrono-cube-ui-bbcc4214d3064d58cf59265db2da326c629232ff.tar.gz |
Create functions for GET and POST requests
Diffstat (limited to 'src/requests.js')
-rw-r--r-- | src/requests.js | 17 |
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 + ); +}; |