Skip to content
Snippets Groups Projects
Commit 81bc340d authored by Thuc Pham's avatar Thuc Pham
Browse files

add warning when no file server url prefix

parent ddf3aef7
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,14 @@ function getNodeUrl(metadata: Metadata) { ...@@ -21,9 +21,14 @@ function getNodeUrl(metadata: Metadata) {
const url = metadata["URL"]; const url = metadata["URL"];
if (url) return url; if (url) return url;
const fileName = metadata["file_name"]; const fileName = metadata["file_name"];
if (!process.env.FILESERVER_URL_PREFIX) {
console.warn(
"FILESERVER_URL_PREFIX is not set. File URLs will not be generated.",
);
return undefined;
}
if (fileName) { if (fileName) {
const fileServerUrlPrefix = process.env.FILESERVER_URL_PREFIX || ""; return `${process.env.FILESERVER_URL_PREFIX}/data/${fileName}`;
return `${fileServerUrlPrefix}/data/${fileName}`;
} }
return undefined; return undefined;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment