add env variable (#513)

This commit is contained in:
Philip Okugbe
2024-11-28 18:48:25 +00:00
committed by GitHub
parent 8349d8271c
commit d97baf5824
7 changed files with 23 additions and 6 deletions

View File

@ -57,6 +57,14 @@ export function getFileUrl(src: string) {
}
export function getFileUploadSizeLimit() {
const limit = window.CONFIG?.FILE_UPLOAD_SIZE_LIMIT || process?.env.FILE_UPLOAD_SIZE_LIMIT || '50mb';
const limit =getConfigValue("FILE_UPLOAD_SIZE_LIMIT", "50mb");
return bytes(limit);
}
export function getDrawioUrl() {
return getConfigValue("DRAWIO_URL", "https://embed.diagrams.net");
}
function getConfigValue(key: string, defaultValue: string = undefined) {
return window.CONFIG?.[key] || process?.env?.[key] || defaultValue;
}