mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 00:26:01 +00:00
23 lines
499 B
TypeScript
23 lines
499 B
TypeScript
const adapter = process.env.TEST_ADAPTER;
|
|
|
|
const default_config = {
|
|
media_adapter: "local"
|
|
} as const;
|
|
|
|
const configs = {
|
|
cloudflare: {
|
|
media_adapter: "r2"
|
|
}
|
|
}
|
|
|
|
export function getAdapterConfig(): typeof default_config {
|
|
if (adapter) {
|
|
if (!configs[adapter]) {
|
|
throw new Error(`Adapter "${adapter}" not found. Available adapters: ${Object.keys(configs).join(", ")}`);
|
|
}
|
|
|
|
return configs[adapter] as typeof default_config;
|
|
}
|
|
|
|
return default_config;
|
|
} |