summaryrefslogtreecommitdiff
path: root/src/requests.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 02:32:09 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 02:32:26 +0300
commit64a537425a05a15ecfac3bf314735876dbbd8ed7 (patch)
tree526d83464a470ee8311744b4736ae7545c0fcd30 /src/requests.ts
parentcfb287490d353166cf0a3db7105d8002cc473f00 (diff)
downloadcommercel-ui-64a537425a05a15ecfac3bf314735876dbbd8ed7.tar.gz
feat: pull Products from api
Diffstat (limited to 'src/requests.ts')
-rw-r--r--src/requests.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/requests.ts b/src/requests.ts
new file mode 100644
index 0000000..2873b37
--- /dev/null
+++ b/src/requests.ts
@@ -0,0 +1,11 @@
+import axios from 'axios';
+
+const baseURL = process.env.NODE_ENV === 'production'
+ ? 'PUT_PRODUCTION_URL_HERE'
+ : 'http://localhost:3030';
+
+const requests = axios.create({ baseURL });
+
+export const { get, post, put, patch } = requests;
+export default requests;
+