File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ import * as describe from '@openfn/describe-package';
6
6
import createCompletionProvider from './magic-completion' ;
7
7
import { initiateSaveAndRun } from '../common' ;
8
8
9
+ const LOCAL_ADAPTORS_ROOT = 'http://localhost:5000' ;
10
+
9
11
async function * fetchDTSListing ( specifier : string ) {
10
12
if ( specifier . endsWith ( '@local' ) ) {
11
13
const lang = specifier
12
14
. replace ( '@local' , '' )
13
15
. replace ( '@openfn/language-' , '' ) ;
14
- const url = `http://localhost:5000 /packages/${ lang } /types` ;
16
+ const url = `${ LOCAL_ADAPTORS_ROOT } /packages/${ lang } /types` ;
15
17
const r = await fetch ( url , { headers : { Accept : 'application/json' } } ) ;
16
18
const json = await r . json ( ) ;
17
19
for ( const f of json . files ) {
@@ -24,7 +26,7 @@ async function* fetchDTSListing(specifier: string) {
24
26
const fetchFile = async ( path : string ) => {
25
27
if ( path . includes ( '@local' ) ) {
26
28
path = path . replace ( '@openfn/language-' , '' ) . replace ( '@local' , '' ) ;
27
- const url = `http://localhost:5000 /packages/${ path } ` ;
29
+ const url = `${ LOCAL_ADAPTORS_ROOT } /packages/${ path } ` ;
28
30
return fetch ( url , { headers : { Accept : 'text/plain' } } ) . then ( r =>
29
31
r . text ( )
30
32
) ;
You can’t perform that action at this time.
0 commit comments