Browse Source

Show console.log 'Legacy attachments route loaded' only when environment variable DEBUG=true.

Thanks to xet7 !
Lauri Ojansivu 1 week ago
parent
commit
1c84b19f24
1 changed files with 3 additions and 1 deletions
  1. 3 1
      server/routes/legacyAttachments.js

+ 3 - 1
server/routes/legacyAttachments.js

@@ -4,7 +4,9 @@ import { ReactiveCache } from '/imports/reactiveCache';
 import { getAttachmentWithBackwardCompatibility, getOldAttachmentStream } from '/models/lib/attachmentBackwardCompatibility';
 import { getAttachmentWithBackwardCompatibility, getOldAttachmentStream } from '/models/lib/attachmentBackwardCompatibility';
 
 
 // Ensure this file is loaded
 // Ensure this file is loaded
-console.log('Legacy attachments route loaded');
+if (process.env.DEBUG === 'true') {
+  console.log('Legacy attachments route loaded');
+}
 
 
 /**
 /**
  * Legacy attachment download route for CollectionFS compatibility
  * Legacy attachment download route for CollectionFS compatibility