From 8b4f8e55962690145834866edd64d45b87b3a545 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 10 Jun 2020 20:10:33 +0300 Subject: feat: implement get/post functions --- src/requests.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/requests.ts (limited to 'src') diff --git a/src/requests.ts b/src/requests.ts new file mode 100644 index 0000000..c653073 --- /dev/null +++ b/src/requests.ts @@ -0,0 +1,12 @@ +import axios from 'axios'; + +const baseApiUrl = 'http://localhost:3030'; + +export const get = (url: string) => { + return axios.get(baseApiUrl + url) +}; + +export const post = (url: string, data: object) => { + return axios.post(baseApiUrl + url, data); +}; + -- cgit v1.2.3