diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-10 20:10:33 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-10 20:10:33 +0300 |
commit | 8b4f8e55962690145834866edd64d45b87b3a545 (patch) | |
tree | cde87df132c267ecff17278f617570c10ecd5f7f /src | |
parent | 9473f8836bc65d1e0ea87607def54b86d719bbc8 (diff) | |
download | which-ui-8b4f8e55962690145834866edd64d45b87b3a545.tar.gz |
feat: implement get/post functions
Diffstat (limited to 'src')
-rw-r--r-- | src/requests.ts | 12 |
1 files changed, 12 insertions, 0 deletions
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); +}; + |