@seshuk/payload-storage-bunny
Version:
Payload storage adapter for Bunny.net
11 lines (10 loc) • 414 B
JavaScript
import { posix } from 'node:path';
export const getGenerateURL = ({ storage, stream })=>{
return ({ data, filename, prefix = '' })=>{
if (stream && data.bunnyVideoId) {
return `https://${stream.hostname}/${data.bunnyVideoId}/playlist.m3u8`;
}
return `https://${storage.hostname}/${encodeURI(posix.join(prefix, filename))}`;
};
};
//# sourceMappingURL=generateURL.js.map