aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authoreeng5 <eleanor.eng5@gmail.com>2019-11-19 17:49:37 -0500
committereeng5 <eleanor.eng5@gmail.com>2019-11-19 17:49:37 -0500
commit7347f1eb7320e5e95f87c64b3222e4b4c1593be5 (patch)
tree180b80e3f32cb8d9499d1f1568cdee593abf799c /src/Utils.ts
parentf194abe2a54158bb041e1e0e7cfa6e22c669629f (diff)
parent8b6f70cd0ddac6d2669c3b0624d59a866737497c (diff)
Merge branch 'server_refactor' of https://github.com/browngraphicslab/Dash-Web into server_refactor
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 4f4db854d..13d1be767 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -48,6 +48,11 @@ export namespace Utils {
return prepend("/corsProxy/") + encodeURIComponent(url);
}
+ export async function getApiKey(target: string): Promise<string> {
+ const response = await fetch(prepend(`environment/${target.toUpperCase()}`));
+ return response.text();
+ }
+
export function CopyText(text: string) {
var textArea = document.createElement("textarea");
textArea.value = text;
@@ -197,7 +202,7 @@ export namespace Utils {
}
let idString = (message.id || "").padStart(36, ' ');
prefix = prefix.padEnd(16, ' ');
- console.log(`${prefix}: ${idString}, ${receiving ? 'receiving' : 'sending'} ${messageName} with data ${JSON.stringify(message)}`);
+ console.log(`${prefix}: ${idString}, ${receiving ? 'receiving' : 'sending'} ${messageName} with data ${JSON.stringify(message)} `);
}
function loggingCallback(prefix: string, func: (args: any) => any, messageName: string) {