mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
* init e2e * updated/moved vitest, finished merge * fix bun picking up e2e tests * e2e: overwrite webserver config with env * e2e: added adapter configs * e2e: replaced image
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;
|
|
} |