File tree 2 files changed +17
-6
lines changed
2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1
- VITE_API_KEY=
2
- VITE_API_SECRET=
1
+ VITE_SIMPLICATE_TENANT_BASE_URL=
2
+ VITE_SIMPLICATE_API_KEY=
3
+ VITE_SIMPLICATE_API_SECRET=
Original file line number Diff line number Diff line change 1
1
import axiosPlugin from 'axios' ;
2
2
3
+ let tenantURL = import . meta. env . VITE_SIMPLICATE_TENANT_BASE_URL ;
4
+ if ( ! tenantURL ) {
5
+ throw new Error ( 'VITE_SIMPLICATE_TENANT_BASE_URL is not defined' ) ;
6
+ }
7
+ if ( ! tenantURL . endsWith ( '/' ) ) {
8
+ tenantURL += '/' ;
9
+ }
10
+
11
+ const baseURL = `${ tenantURL } /api/v2/` ;
12
+
3
13
export const axios = axiosPlugin . create ( {
4
- baseURL : 'https://demofonkel.simplicate.nl/api/v2/' ,
14
+ baseURL,
5
15
timeout : 3000 ,
6
16
headers : {
7
- 'Authentication-Key' : import . meta. env . VITE_API_KEY ,
8
- 'Authentication-Secret' : import . meta. env . VITE_API_SECRET ,
9
- }
17
+ 'Authentication-Key' : import . meta. env . VITE_SIMPLICATE_API_KEY ,
18
+ 'Authentication-Secret' : import . meta. env . VITE_SIMPLICATE_API_SECRET ,
19
+ } ,
10
20
} ) ;
You can’t perform that action at this time.
0 commit comments