Skip to content

Commit 01288cc

Browse files
DimitarTachevFatme
authored andcommitted
refactor: move the playground files upload url to the config
1 parent 1e9c7a0 commit 01288cc

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

config/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"CI_LOGGER": false,
55
"ANDROID_DEBUG_UI_MAC": "Google Chrome",
66
"USE_POD_SANDBOX": false,
7-
"DISABLE_HOOKS": false
7+
"DISABLE_HOOKS": false,
8+
"UPLOAD_PLAYGROUND_FILES_ENDPOINT": "https://play.nativescript.org/api/files"
89
}

lib/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export class Configuration extends ConfigBase implements IConfiguration { // Use
88
TYPESCRIPT_COMPILER_OPTIONS = {};
99
ANDROID_DEBUG_UI: string = null;
1010
USE_POD_SANDBOX: boolean = false;
11+
UPLOAD_PLAYGROUND_FILES_ENDPOINT: string = null;
1112

1213
/*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/
1314
constructor(protected $fs: IFileSystem) {

lib/declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ interface IStaticConfig extends Config.IStaticConfig { }
382382
interface IConfiguration extends Config.IConfig {
383383
ANDROID_DEBUG_UI: string;
384384
USE_POD_SANDBOX: boolean;
385+
UPLOAD_PLAYGROUND_FILES_ENDPOINT: string;
385386
}
386387

387388
interface IApplicationPackage {

lib/services/livesync/playground/preview-sdk-service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export class PreviewSdkService extends EventEmitter implements IPreviewSdkServic
1010

1111
constructor(private $errors: IErrors,
1212
private $logger: ILogger,
13-
private $httpClient: Server.IHttpClient) {
13+
private $httpClient: Server.IHttpClient,
14+
private $config: IConfiguration) {
1415
super();
1516
}
1617

@@ -74,10 +75,9 @@ export class PreviewSdkService extends EventEmitter implements IPreviewSdkServic
7475
onDevicesPresence: (devices: Device[]) => ({ }),
7576
onSendingChange: (sending: boolean) => ({ }),
7677
onBiggerFilesUpload: async (filesContent, callback) => {
77-
// TODO: stop using the playground endpoint when we have a direct Amazon one
7878
const gzippedContent = new Buffer(pako.gzip(filesContent));
7979
const playgroundUploadResponse = await this.$httpClient.httpRequest({
80-
url: "https://play.telerik.rocks/api/files",
80+
url: this.$config.UPLOAD_PLAYGROUND_FILES_ENDPOINT,
8181
method: "POST",
8282
body: gzippedContent,
8383
headers: {

0 commit comments

Comments
 (0)