File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,6 @@ NEXT_PUBLIC_VERCEL_ENV=development
11
11
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
12
12
13
13
INDEX_COOP_API_V2_KEY=
14
+
15
+
16
+ KUBB_ENV=local # local, or absent / anything else for prod
Original file line number Diff line number Diff line change @@ -3,10 +3,18 @@ import { pluginClient } from '@kubb/plugin-client'
3
3
import { pluginOas } from '@kubb/plugin-oas'
4
4
import { pluginTs } from '@kubb/plugin-ts'
5
5
6
+ import dotenv from 'dotenv'
7
+
8
+ dotenv . config ( )
9
+
10
+ const isLocal = process . env . KUBB_ENV === 'local'
11
+
6
12
const config = defineConfig ( {
7
13
root : '.' ,
8
14
input : {
9
- path : 'https://api.indexcoop.com/v2/docs/json' ,
15
+ path : isLocal
16
+ ? 'http://127.0.0.1:4000/documentation/json' // Requires the indexcoop-api to be running locally
17
+ : 'https://api.indexcoop.com/v2/docs/json' ,
10
18
} ,
11
19
output : {
12
20
path : './src/gen' ,
@@ -35,7 +43,9 @@ const config = defineConfig({
35
43
dateType : 'date' ,
36
44
} ) ,
37
45
pluginClient ( {
38
- baseURL : 'https://api-q513.onrender.com' ,
46
+ baseURL : isLocal
47
+ ? 'http://127.0.0.1:4000' // Requires the indexcoop-api to be running locally
48
+ : 'https://api-q513.onrender.com' ,
39
49
output : {
40
50
path : './clients/axios' ,
41
51
barrelType : 'propagate' ,
You can’t perform that action at this time.
0 commit comments