diff options
Diffstat (limited to 'src/requests.ts')
-rw-r--r-- | src/requests.ts | 24 |
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 + ) +}; |