In sites/avivator/src/source-info.js, the export always concatenates baseUrl with path.
This prevents using custom/external URLs (ex. http://localhost:8000/file.ome.tiff) without modifying the export logic, since it creates invalid URLs like:
https://viv-demo.storage.googleapis.com/http://localhost:8000/file.ome.tiff
Use Case:
When testing local files or using custom endpoints (local servers, different cloud providers, proxy endpoints), users need to provide complete URLs that shouldn't be prefixed with baseUrl.
Proposed Solution:
Check if urlOrFile already exists before constructing from baseUrl:
export default sources.map(s => ({
urlOrFile: s.urlOrFile || `${baseUrl}/${s.path}`,
description: s.description,
offsets: s.offsets
}));
This maintains backward compatibility while allowing:
const sources = [
{
// custom url - not concatenated
urlOrFile: 'http://localhost:8000/test.ome.tiff',
description: 'Local test file',
offsets: 'http://localhost:8000/test.offsets.json'
},
{
// existing behavior - uses baseUrl
path: 'demo-file.ome.tif',
description: 'Demo file'
}
];
Benefits
- Enables local development/testing without code modification
- Supports multiple storage backends
- Backward compatible with existing demo sources
- Also preserves offsets field which is currently dropped
In sites/avivator/src/source-info.js, the export always concatenates baseUrl with path.
This prevents using custom/external URLs (ex.
http://localhost:8000/file.ome.tiff) without modifying the export logic, since it creates invalid URLs like:Use Case:
When testing local files or using custom endpoints (local servers, different cloud providers, proxy endpoints), users need to provide complete URLs that shouldn't be prefixed with baseUrl.
Proposed Solution:
Check if urlOrFile already exists before constructing from baseUrl:
This maintains backward compatibility while allowing:
Benefits