diff options
| author | Anton Dubik <44112567+asketonim@users.noreply.github.com> | 2020-01-02 14:19:55 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-02 14:19:55 +0300 | 
| commit | 2201113c6c55352159e20d083a59ae2373ba56cc (patch) | |
| tree | 8f953ba4dc419012b9baa5e15479bf1589ab1113 /src/requests.js | |
| parent | 7b8dd0a9a222323d52cb22e93518430c793353f5 (diff) | |
| parent | bbcc4214d3064d58cf59265db2da326c629232ff (diff) | |
| download | chrono-cube-ui-2201113c6c55352159e20d083a59ae2373ba56cc.tar.gz | |
Merge pull request #11 from Eug-VS/requests
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 +  ); +};  |