From e32c8be0a4b7f135c01449c3603da347728819a8 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 21 Mar 2020 14:35:19 +0300 Subject: chore: migrate requests.ts --- src/requests.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/requests.ts (limited to 'src/requests.ts') 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 + ) +}; -- cgit v1.2.3