File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { postProcessClient } from './utils/postprocess';
15
15
16
16
const isPlatformPath = ( path : string ) =>
17
17
path . startsWith ( 'https://get.heyapi.dev' ) ;
18
+ // || path.startsWith('http://localhost:4000')
18
19
19
20
export const compileInputPath = ( input : Config [ 'input' ] ) => {
20
21
const result : Pick <
@@ -106,7 +107,20 @@ export const compileInputPath = (input: Config['input']) => {
106
107
107
108
const query = queryParams . join ( '&' ) ;
108
109
const platformUrl = baseUrl || 'get.heyapi.dev' ;
109
- const compiledPath = `https://${ [ platformUrl , result . organization , result . project ] . join ( '/' ) } ` ;
110
+ const isLocalhost = platformUrl . startsWith ( 'localhost' ) ;
111
+ const platformUrlWithProtocol = [
112
+ isLocalhost ? 'http' : 'https' ,
113
+ platformUrl ,
114
+ ] . join ( '://' ) ;
115
+ const compiledPath = isLocalhost
116
+ ? [
117
+ platformUrlWithProtocol ,
118
+ 'v1' ,
119
+ 'get' ,
120
+ result . organization ,
121
+ result . project ,
122
+ ] . join ( '/' )
123
+ : [ platformUrlWithProtocol , result . organization , result . project ] . join ( '/' ) ;
110
124
result . path = query ? `${ compiledPath } ?${ query } ` : compiledPath ;
111
125
112
126
return result ;
You can’t perform that action at this time.
0 commit comments