mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 21:06:04 +00:00
adapter(cloudflare): removed durable mode, added withPlatformProxy (#233)
* removed `durable` mode as it requires an import from "cloudflare:" that often fails in non-cf environments * remove worker configuration types * add `withPlatformProxy` * withPlatformProxy: make configuration optional
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { registries, isDebug, guessMimeType } from "bknd";
|
||||
import { registries as $registries, isDebug, guessMimeType } from "bknd";
|
||||
import { getBindings } from "../bindings";
|
||||
import { s } from "bknd/utils";
|
||||
import { StorageAdapter, type FileBody } from "bknd";
|
||||
@@ -12,7 +12,10 @@ export function makeSchema(bindings: string[] = []) {
|
||||
);
|
||||
}
|
||||
|
||||
export function registerMedia(env: Record<string, any>) {
|
||||
export function registerMedia(
|
||||
env: Record<string, any>,
|
||||
registries: typeof $registries = $registries,
|
||||
) {
|
||||
const r2_bindings = getBindings(env, "R2Bucket");
|
||||
|
||||
registries.media.register(
|
||||
|
||||
Reference in New Issue
Block a user