File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export interface ConfigurationOptions extends CoreConfigurationOptions {
16
16
actorRunId ?: string ;
17
17
actorTaskId ?: string ;
18
18
apiBaseUrl ?: string ;
19
+ // apiBaseUrl is the internal API URL, accessible only within the platform(private network),
20
+ // while apiPublicBaseUrl is the public API URL, available externally(through internet).
19
21
apiPublicBaseUrl ?: string ;
20
22
containerPort ?: number ;
21
23
containerUrl ?: string ;
Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ import { Actor, log } from 'apify';
2
2
3
3
await Actor . init ( ) ;
4
4
5
- const { data, recordKey } = await Actor . getInput ( ) ;
5
+ const { data } = await Actor . getInput ( ) ;
6
6
7
- await Actor . setValue ( recordKey , JSON . stringify ( data ) , { contentType : `application/json` } ) ;
7
+ await Actor . setValue ( 'public-record-key' , JSON . stringify ( data ) , { contentType : `application/json` } ) ;
8
8
9
9
const defaultKeyValueStore = await Actor . openKeyValueStore ( ) ;
10
- const publicUrl = defaultKeyValueStore . getPublicUrl ( recordKey ) ;
10
+ const publicUrl = defaultKeyValueStore . getPublicUrl ( 'public-record-key' ) ;
11
11
12
12
// Here we store the url itself
13
13
await Actor . setValue ( 'urlToPublicData' , publicUrl ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const client = new ApifyClient({
10
10
11
11
const actor = client . actor ( process . argv [ 2 ] ) ;
12
12
13
- const run = await actor . call ( { data : PUBLIC_DATA , recordKey : 'public-record-key' } , { waitSecs : 15 } ) ;
13
+ const run = await actor . call ( { data : PUBLIC_DATA } , { waitSecs : 15 } ) ;
14
14
assert . equal ( run . exitCode , 0 ) ;
15
15
16
16
const publicUrl = await client . keyValueStore ( run . defaultKeyValueStoreId ) . getRecord ( 'urlToPublicData' ) ;
You can’t perform that action at this time.
0 commit comments